views:

14

answers:

1

I have a listener bean which calls on a session beans method in the MDBs onMessage method. If an exception occurs, such as IllegalStateException (which I throw) or NPE, then JBoss keeps logging the exception, and also keeps retrying to deliver the same message, again spamming the logs, then it sends the message to DLQ, and again calls onMessage which again fails... madness.

Is there any way to stop this? Is there a configuration property for an MDB which tells, if any exceptions occurs in the onMessage (if onMessage doesnt return) retry X times, then fricking stop trying! Is there?

A: 

are you using listener ports or activation specs? I don't use JBoss, I use WebSphere, but I found that under the listener port area in WebSphere you can set the max retry count. Also perhaps there is a spot in your administration console where you could change the logging levels so it doesn't spam you? Lastly I would look for a property in your message header called retryCount (or create one if you don't have one). Then use that and check for it in your bean. If it reads it and you have failed N times, then automatically forward to the DLQ without JBoss doing it for you. Might save you some headache.

Chris Aldrich
The problem is jBoss does put the message in the DLQ, but it then continues trying to deliver the same message as it didnt go to DLQ. If I turn of the logging, then still I know jboss will be spinning and eating away on CPU on useless exceptions and retries.
AntonioP