↓ Skip to main content

WebSphere MQ non-ASF in WAS

Application Server Facilities (ASF) are the part of the JMS specification originally designed, amongst other things, to allow application server’s to retrieve messages for delivery to message-driven beans. Now WebSphere MQ’s ASF implementation had one significant flaw when it comes to multiple consumers pulling messages from the same queue. Each consumer was effectively browsing the queue looking for suitable messages and, when they found one, they then attempted to take a lock in order to consume the message. Unfortunately, inbetween the browse and the lock there’s a good chance that another consumer would have nipped in and stolen the message. This inefficient behaviour meant that you were unlikely to see linear scalability when adding multiple MDB consumers to a deep queue. As a result, some customers have switched their WebSphere Application Server listener port service to use non-ASF mode (the custom properties required for this can be found in the InfoCenter). This use a standard message consumer to poll the queue for messages - the downside being that you need a separate thread for each consumer.

There are, however, two relatively new innovations that make this picture more complex. Firstly, WebSphere MQ v7 brings to the distributed platform the browse-mark behaviour that previously existed only on the mainframe. This basically allows the connection consumer to lock messages as it browses the queue thereby ensuring that, when it decides to consume one, it is still available. Secondly, ASF is now old technology with the J2EE Connector Architecture 1.5 specification providing the preferred mechanism for integration between a JMS provider and application server MDBs. In WebSphere Application Server v7 this manifests itself as the WebSphere MQ resource adapter.

The good news is that, if you have a WebSphere MQ v7 queue manager, then the WebSphere MQ v7 JMS provider will automatically use the new browse-mark behaviour for both ASF and the resource adapter. If you are currently using non-ASF, you should therefore switch away from that to one of these two mechanisms when moving to WebSphere Application Server v7. However, if you still have a v6 queue manager and have previously been using non-ASF then you should continue to do and not switch to the resource adapter as this uses the same underlying technology as ASF.

Thanks to Ben Ritchie, Mark Whitlock and Matthew White for providing insight in to the new behaviour.

Related

New WebSphere blogs

There has been a recent push to get more of the WebSphere development team out in to the blogosphere in the run up to the release of V7 of the Application Server. The standard form seems to be to advertise new blogs on the WebSphere Community Blog. So far there is one covering WebSphere and Java Persistence, and likely to be of particular interest to readers of this blog, one on WebSphere and Messaging. Note that the latter doesn’t cover WebSphere MQ (see this blog if that’s your area of interest) but rather the default messaging provider in WebSphere Application Server. Expect to see lots of good material on some of the new features and make the most of the chance to interact with the development team. Whilst on the subject of new blogs, if DataPower is your bag then you can read all about a forthcoming book from some of my ex-ISSW colleagues here.

WebSphere MQ Java in J2EE

Thanks once again to Paul Titheridge, this time for pointing me to this technote covering the use of the WebSphere MQ Java APIs in a J2EE/JEE environment. It seems that IBM does now support the use of the WebSphere MQ Java interfaces in a WebSphere Application Server environment (check the supported software for your release) but this technote provides you with lots of reasons why you shouldn’t! The Java interfaces do have functionality that isn’t currently available in the JMS API (for example message segmentation and important parts of message grouping) but that needs to be weighed carefully against the drawbacks. JMS should always be the default option unless you have a very good reason not to use it.