YOUR FEEDBACK
Rapid Module Development for DotNetNuke
MICHEAL SMITH wrote: GO TO THE LINK, U HAVE EVERYTHING U WANT THERE. MICHEAL...
SOA World Conference
Virtualization Conference
$50 Savings Expire May 23, 2008... – Register Today!

SYS-CON.TV
TOP THREE LINKS YOU MUST CLICK ON


Message-Driven Beans in WebSphere
Use MQ Messaging for Many Processes

Digg This!

With WebSphere Application server 5.0+ you can now add Message-Driven Beans (MDBs) to your WebSphere arsenal. These beans are handy for many processes. I recently had to write a MDB using MQ Series. WebSphere Application Server (WAS) 5.0 had the same functionality built-in, but I had a hard time learning how to use it. I also encountered some issues while configuring it to run in a load-balanced environment.

First of all, there's no real way of balancing the load in a clustered environment for MDBs. All nodes in the cluster will fight for the messages as they enter the queue. This is a limitation that can't be worked around.

There's another pitfall that will affect you even if you don't plan to use load balancing. If for any reason the queue manager connection fails, your MDB will be rendered useless until someone restarts the message listener service on the application server.

That said let's build an MDB. First you'll want to get some information about the queue you're attaching to. The Queue Manager name, Host, Port, Channel name, and Queue name will most likely be enough information. You'll have to create both a Destination and a Connection Factory.

To create a destination you'll want to go to the WebSphere Console and go to: Resources - WebSphere MQ JMS Provider - a WebSphere MQ Queue Destinations. At this point you'll want to decide at which level you'd like this information to be available. If you're in a load-balanced environment there's only one that will allow all the cells to play nicely together, and that's the cell level. Choose a JNDI name and note it for later use. Then populate the appropriate queue info on the next screen.

Once you've done that we'll have to create the Queue Connection Factory. This is found at: Resources - WebSphere MQ JMS Provider - a WebSphere MQ Queue Connection Factories. Here again, if you're in a load-balanced environment, make sure to create these at the cell level. Choose a JNDI name and note it for later use. Then, on the next page, populate the queue information.

At this point we're ready for the final piece of the puzzle, we have to create a Listener Port. All this really does is take the factory and bind it to the destination, and then manage the two. To create a port, go to Application Servers - (your server's name) - Message Listener Service. Here you'll create a port and assign it a JNDI name. This JNDI name will be used by your application to talk to the port. The guts of the port is pretty straightforward, just give it the JNDI names for the Connection Factory and Destination. The rest should work with the default values. Once you have that created, go back to the Listener Ports screen.

It's here that you'll probably want to add a little extra info in case your queue manager ever needs to be rebooted or taken down for short periods. We're going to add two custom properties: "MAX.RECOVERY.RETRIES" and "RECOVERY.RETRY.INTERVAL." This will let the Listener Port retry for the specified number of tries, and wait for however long you've set the interval to between tries. The interval value is in seconds.

I've created a simple MDB that will print the contents of a message to the console. This would be a good app to start your testing with. It can be found with this article, see zip.html.

About Jonathan Forck
Jonathan Forck is a J2EE developer who has done key work on several online banking applica- tions developed for a group of banks. Jonathan has written his own imple- mentation of the security interface for WAS 5.1 and is currently working on a plug-in to the Eclipse Framework that will be a clear-text TCP/IP monitor for SSL-encrypted Web sites.

WEBSPHERE LATEST STORIES . . .
3rd International Virtualization Conference & Expo: Themes & Topics
From Application Virtualization to Xen, a round-up of the virtualization themes & topics being discussed in NYC June 23-24, 2008 by the world-class speaker faculty at the 3rd International Virtualization Conference & Expo being held by SYS-CON Events in The Roosevelt Hotel, in midtown
IBM Unveils Insurance Operations of the Future Powered By SOA
IBM announced two new advances in the insurance industry - a solution for improving operational efficiency and a framework for process acceleration - that are designed to help insurance providers lower costs and increase customer satisfaction by handling core processes, such as claims
ParAccel Announces OEM Relationship with IBM
ParAccel announced it has entered into an original equipment manufacturer (OEM) agreement with IBM. Under the terms of the agreement, ParAccel will embed IBM InfoSphere Change Data Capture within the ParAccel Analytic Database, providing ParAccel customers with seamless and real-time u
Microsoft To Keynote 4th International Virtualization Conference & Expo
Mike Neil is general manager for virtualization strategy in the Windows Server Division at Microsoft. Mike is focused on the delivery of the Windows virtualization technology, including Windows Server 2008 Hyper-V, Microsoft Hyper-V Server and Virtual PC 2007. Mike also directs the tec
Micro Focus Upgrades SOA Express for IBM CICS
Micro Focus announced the availability of SOA Express 8.0. The new version adds support for direct deployment into IBM's Customer Information Control System (CICS), enabling users to accelerate the deployment of Web services by reusing their existing CICS TS mainframe infrastructure in
Red Hat Named "Platinum Sponsor" of Virtualization Conference & Expo
Red Hat is a trusted open source provider. Red Hat offers enterprise customers a long-term plan for building infrastructures on the quality and innovation of open source. Combining open source operating system platform, Red Hat Enterprise Linux, together with applications, management
SUBSCRIBE TO THE WORLD'S MOST POWERFUL NEWSLETTERS
SUBSCRIBE TO OUR RSS FEEDS & GET YOUR SYS-CON NEWS LIVE!
Click to Add our RSS Feeds to the Service of Your Choice:
Google Reader or Homepage Add to My Yahoo! Subscribe with Bloglines Subscribe in NewsGator Online
myFeedster Add to My AOL Subscribe in Rojo Add 'Hugg' to Newsburst from CNET News.com Kinja Digest View Additional SYS-CON Feeds
Publish Your Article! Please send it to editorial(at)sys-con.com!

Advertise on this site! Contact advertising(at)sys-con.com! 201 802-3021

SYS-CON FEATURED WHITEPAPERS

ADS BY GOOGLE
BREAKING WEBSPHERE NEWS
Company Profile for BrightStar Partners, Inc.
BrightStar Partners, a professional services and implementation-based solutions company,