Exception handling

36 views
Skip to first unread message

Sathya Narayanan

unread,
Mar 31, 2014, 10:47:33 PM3/31/14
to jboss-gene...@googlegroups.com
Hi,
Can you please help with below questions?


1.       How to set the message redelivery count (# of retries) and redelivery interval for a MDB? So that in case of a runtim exception message is not redelivered indefinitely.

2. How do we configure DLQ?

3.       If the maxSession is set to 1 and if incoming message is bad (throwing an EJBException), will the MDB become inactive and stop processing further messages?

Justin Bertram

unread,
Mar 31, 2014, 10:56:45 PM3/31/14
to jboss-gene...@googlegroups.com
1.       How to set the message redelivery count (# of retries) and redelivery interval for a MDB? So that in case of a runtim exception message is not redelivered indefinitely.

This should be configured on your JMS broker.  You can't configure this on the MDB itself as the generic JMS JCA RA doesn't support this functionality in and of itself.


2. How do we configure DLQ?

See my answer to the previous question.


3.       If the maxSession is set to 1 and if incoming message is bad (throwing an EJBException), will the MDB become inactive and stop processing further messages?

First off, an MDB's onMessage method should not be throwing any exceptions.  The JMS specifications makes clear that such behavior should be considered a programming error.

However, if the MDB's onMessage does happen to throw a RuntimeException of any sort the Java EE container is instructed by spec to destroy the that specific instance of the MDB.  That said, the MDB should recover from this situation and continue to consume messages.
Reply all
Reply to author
Forward
0 new messages