BEA WebLogic Server 9.0 includes several very interesting new features for developers, including support for JMS 1.1, unit-of-order capabilities, MDB enhancements, and XML-based messaging. The key point to remember with WebLogic Server 9.0 is that you will not have to change your JMS code to make your application run in WebLogic Server 9.0, unless you wish to make use of the new features.
WebLogic 9 fully supports JMS 1.1. According to Sun Microsystems' documentation, JMS 1.1 brings about the "unification of programming interfaces for the PTP and Pub/Sub" domains. The consequence is that you can create a transacted session, and then receive from a queue and send to a topic within the same transaction. This was not possible in JMS 1.0. The important part is that JMS 1.1 is backward-compatible with JMS 1.0.
Organizations with legacy systems often find that some of their messaging is dependent on sequence. In the "old" days (before J2EE) when there was only a single message consumer, sequence was not a problem, but it becomes a significant challenge when taking MDBs and clusters into consideration. WebLogic Server 9.0 addresses a part of this puzzle by providing unit-of-order capabilities. This feature works best when a group of messages from a single producer must be processed sequentially.
For example, producer A sends messages X, Y, and Z in a unit-of-order. An MDB picks up message X and processes it. Until the MDB instance commits the transaction, message Y and Z remain on the queue. Only when the MDB commits message X does message Y get processed, and so on.
There are several limitations to unit-of-order:
One point of interest is that the unit-of-order feature works with distributed queues. All messages in one unit-of-order will be sent to one distributed destination member.
There are two ways to create a unit-of-order, either programmatically or through the WebLogic console. WebLogic supplies a
weblogic.jms.extensions.WLMessageProducer class, which implements the
javax.jms.MessageProducer interface. BEA has added two methods:
setUnitOfOrder(). You can use these two methods to set or get the name of the current unit-of-order. WebLogic administrators can configure a unit-of-order for both sessions (via the connection factories) and destinations. These can be overridden by the
The rules for when messages are delivered in a unit-of-order are complex. The golden rule is that if a message producer is closed, the current message processing is completed, and if a transaction is committed, all messages are sent. Each message acknowledgment mode has its own nuances, and these are well documented.
The message-driven beans (MDB) facility in WebLogic Server 9.0 has some significant improvements. Several enhancements stand out, the first three dealing with the problem of looping messages, where the MDB container attempts to deliver the message, the delivery fails, the message is rolled back, the container tries again, and so on ad infinitum.
client-idcan now be created for each instance of an MDB to aid durable subscribers, instead of each type of MDB as was the case in WebLogic 8.1.
resource-adapter-jndi-nameparameter in the
The full list of MDB enhancements is available on BEA's site.
BEA introduced an XML message type extension in WebLogic Server 8.1, which has been enhanced in WebLogic Server 9.0. The
weblogic.jms.extensions.XMLMessage implements the
javax.jms.TextMessage interface, and exposes the
getDocument() methods that pass along an
org.w3c.dom.Document object. This is a worthy extension, but your mileage may vary if you are interfacing with a non-WebLogic system.
The total number of new features in WebLogic Server 9.0 is enormous and far too lengthy to cover in this article. I have shown you some of the key features, including an improved WebLogic console, MDB enhancements, and the new store-and-forward service. This article should provide a picture of the changes WebLogic Server 9.0 will bring to your applications and J2EE environment.
Special thanks to the following people for taking time to review this article, and for their suggestions about which JMS features should be included: Tom Barnes, Lauren Cooney, Michael Kovacs, Kathiravan Sengodan, Jeff Schieli, and Carolyn Wong.
Michael Hart is a systems engineer at a high tech firm in Ontario, Canada, where he assists helps design and support a large WebLogic implementation.