Unchecked Exception Handling for Message Driven Bean
 Technote (troubleshooting)
 
Problem(Abstract)
If an unchecked exception is thrown back to the onMessage() method of the Message Driven Bean(MDB), the message delivery will be retried. After the maximum message delivery retry count is reached, the MDBListener will be stopped. This can be unwanted behavior in some cases. How can one set WebSphere so that when the unhandled exception occurs, instead stopping the MDB listener, just discard the message that caused the unchecked exception to be thrown and go on to the next message in the queue?
 
Resolving the problem
This can be achieved by using MQSeries facilities and configuring the MDB ListenerPort as following:
Using MQSeries explorer or runmqsc <qmgr>, enable the Hardened Backout, set the Backout Threshold to be 1, set the Backout Queue name to be the Dead Letter Queue
and ensure that the MDB ListenerPort maxRetries value is greater than the BackoutThreshold value.
Then on the first time that a message causes an unexpected exception to be thrown, it will be moved to the backout queue and the MDB listener will continue processing.
 
 
Cross Reference information
Segment Product Component Platform Version Edition
Application Servers Runtimes for Java Technology Java SDK
 
 


Document Information


Product categories: Software > Application Servers > Distributed Application & Web Servers > WebSphere Application Server > Java Message Service (JMS)
Operating system(s): Windows
Software version: 5.0
Software edition:
Reference #: 1110513
IBM Group: Software Group
Modified date: May 21, 2003