Win a copy of Design for the Mind this week in the Design forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Transaction- rollback the messages for singleton service in case error occurs(used MDB)

 
Neelam Hankare
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi all,
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..
More detail:
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...


Thanks,
Neelam.
 
Pazhanikanthan Periasamy
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic