Transaction- rollback the messages for singleton service in case error occurs(used MDB)
posted 5 years ago
I have tried implementing singleton servcie in MDB,but dint work as expected..Without MDB , implementation of Singleton service is wokring fine..but wanted to achieve transactionality..
1. Singleton servcie will picked up the message from foriegn jms queue using onMessage().
2. It will send the message to some other service (like proxy service).
3. If some error occurs ,it should rollback the entire transaction as well as put the message to original queue..
4. Rollbacked message will get again picked up by singleton service without loosing sequencing.
In short, Message wont get loss until successful delivery.
Please suggest some few approach to achieve rollback operation...
posted 4 years ago
Do you realize what this technique will result in?
1. Let us say the queue contains multiple messages to be processed, and if the 1st message has a rollback error like the one which you described, none of the other messages will never be processed.
I would advice you a mechanism to create error queues and throw the erroneous messages into it for processing by another bean.