Jun 10th, 2011, 01:43 PM
client not getting messages after throwing exception
We are using hornetq 2.2.1 final and spring integration 2.0.3
This is what happens:
There are 10 messages on "myQueue"
The listener pulls a message off of myQueue.
The business process code throws an exception while processing the message.
At this point no more messages come off of the queue.
I'm using a jms:message-driven-channel-adapter. If I specify an error-channel, messages continue to come off of the queue after the message comes in that results in a thrown exception. However, I really want the exception to go all the way back to hornetq. I have hornetq configured to try X number of times after a Y delay.
When I remove the error-channel messages no longer come off the queue.
I have this configuration:
<bean id="myMessageListenerContainer" class="my.package.MySimpleMessageListenerContainer ">
<property name="destination" ref="myDestination" />
<property name="concurrentConsumers" value="1" />
<property name="connectionFactory" ref="connectionFactory" />
<property name="sessionTransacted" value="true" />
<property name="errorHandler" ref="myErrorHandler" />
MySimpleMessageListenerContainer extends SimpleMessageListenerContainer
I'm not sure if the problem is on the spring integration side or the hornetq side. My guess is that the exception is not getting back to the hornet queue and therefore my listener thread is stuck because it didn't acknowledge back to the jms server.
Like I said, with the error-channel, the exception does not get thrown back as designed and all the messages come off the queue as designed. Unfortunately I want the exception to get thrown back to the jms server so it can be retried.
The reason I have MySimpleMessageListenerContainer is so I can override the onException to make sure I can catch and log all exceptions that get thrown back.
Any help would be appreciated.
Tags for this Thread