-
Oct 22nd, 2008, 02:33 PM
#1
DefaultMessageListenerContainer's transaction handling
I'm testing the function to receive from a queue in a transaction. My dequeue app setting:
<bean id="jmsContainer" class="org.springframework.jms.listener.DefaultMes sageListenerContainer">
<property name="connectionFactory" ref="jmsFactory"/>
<property name="destination" ref="emailQueue"/>
<property name="messageListener" ref="messageListener"/>
<property name="sessionTransacted" value="true"/>
</bean>
(And I have maxConcurrentConsumer as 1)
In the message handler, I throw a RuntimeException to try to break the transaction. And I want to see if a message I put in the queue is still there. However the dequeue app read the same message 7 times (exception thrown 7 times), then the message disappeared.
I wonder what is happening when exception happened. Is the message get back the queue or what?
Actually I don't understand the concept to read message in a transaction, with a listener. If the transaction fails, is the message put back to the queue? Then how do we tell the listener not to dequeue this message again? And if we can, how do we tell the listener to pick this message at a later time?
Many thanks!
Michael
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules