Exception handling for message-driven EJBs - best practices?
posted 8 years ago
So I've got a MDB and I hear that if the MDB throws an exception in the onMessage() method, the JMS provider (WebSphere MQ 5.3) will go ahead and put the message back on the queue (and after a few retries, I think it goes to an error queue).
That's the behavior I want. If the above is true, then what's the best practice for throwing the exception? I can't change the throws clause on the method without getting compiler errors, unless it's a Runtime exception. So should I just throw a runtime exception? Or am I missing something?