-
1. Re: RuntimeException in MessageHandler doesn't rollback consumer transaction
clebert.suconic Oct 17, 2011 5:46 PM (in response to felipekamakura)you are supposed to rollback yourself. Core is a lower level API, so we don't follow the same semantic as JMS messageConsumers.
-
2. Re: RuntimeException in MessageHandler doesn't rollback consumer transaction
clebert.suconic Oct 17, 2011 5:46 PM (in response to clebert.suconic)By LowerLevel I didn't mean more complex or anything like that. It's just that you have finer control.
-
3. Re: RuntimeException in MessageHandler doesn't rollback consumer transaction
felipekamakura Oct 17, 2011 8:33 PM (in response to clebert.suconic)Ok I see. Thanks a lot Clebert! I would suggest to put that semantic difference somewhere in the User Guide.
Just one more thing:
Even if I set max-delivery-attempts on hornetq-configuration.xml the message is being delivered forever. It doesn't stop at the max. Am I configuring it wrong? Could you shed a light on this please?
-
4. Re: RuntimeException in MessageHandler doesn't rollback consumer transaction
clebert.suconic Oct 17, 2011 9:38 PM (in response to felipekamakura)It should be defined at the address-settings... the default is 10. Maybe you could place the address settings here as a post.
-
5. Re: RuntimeException in MessageHandler doesn't rollback consumer transaction
clebert.suconic Oct 17, 2011 9:39 PM (in response to clebert.suconic)Is that on 2.2.5.GA?
I wouldn't use 2.0.0.GA
-
6. Re: RuntimeException in MessageHandler doesn't rollback consumer transaction
felipekamakura Oct 18, 2011 1:04 PM (in response to clebert.suconic)So here is the snippet of my hornetq-configuration.xml:
<address-settings> <!--default for catch all--> <address-setting match="#"> <redelivery-delay>1000</redelivery-delay> <max-delivery-attempts>10</max-delivery-attempts> </address-setting> </address-settings>
The redelivery delay works perfectly, but the max-delivery-attempts seems to be ignored.
Clebert, I've tested that behavior in both versions. I am using 2.0.0ga because I'm using HornetQ Server embedded, and we have a requirement of JRE 1.5 compatibility. Do you strongly recommend not using that version?
-
7. Re: RuntimeException in MessageHandler doesn't rollback consumer transaction
clebert.suconic Oct 18, 2011 1:21 PM (in response to felipekamakura)There are a few issues on 2.0.0.GA. I would recomment 2.2.5 yeah.
I'm not sure why the redelivery is not working for you. I would need to see a sample.
-
8. Re: RuntimeException in MessageHandler doesn't rollback consumer transaction
felipekamakura Oct 18, 2011 2:02 PM (in response to clebert.suconic)I'll put together a small example that reproduces my problem.
Thanks
-
9. Re: RuntimeException in MessageHandler doesn't rollback consumer transaction
felipekamakura Oct 24, 2011 11:13 AM (in response to felipekamakura)Oh, I found out why the max-delivery-attemps wasn't working. That's because my handler was rolling back the transaction but wasn't acking the message. Now everything is working normally.
Thanks again for the support.
-
10. Re: RuntimeException in MessageHandler doesn't rollback consumer transaction
awelynant May 26, 2012 2:00 PM (in response to felipekamakura)I know this is an old thread, but could you post your final working code snippet that rollsback properly and handles regular success properly? Thanks.
-
11. Re: RuntimeException in MessageHandler doesn't rollback consumer transaction
clebert.suconic May 26, 2012 10:31 PM (in response to awelynant)that's a simple call to msg.acknowledge(); and then session.rollback or sesison.commit(); He's talking about core-api here.