File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

MQ rollback

 
Naveen Sampra
Ranch Hand
Posts: 70
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Here is a problem I am having with reading from a MQ queue.
I am reading messages from a queue. I then want to ftp this information. If my ftp fails, I want to block and try read the same message again. But when I read from the queue, the message is taken off. How do I read so that the message is not removed from the queue ?
Can anyone help ?
 
Dana Hanna
Ranch Hand
Posts: 227
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
This should be an MQ vendor, or an appserver vendor specific thing. Maybe not - it may be part of JMS....
Either way, try throwing an exception from your onMessage() method. Then look at the MQ and appserver docs to find out whats up.
 
Kyle Brown
author
Ranch Hand
Posts: 3892
5
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
This is a part of JMS. You're asking who's the transaction manager -- in a J2EE app server, that would be the application server itself. Take a look at the EJB specification on MDB's (or Richard Monson-Haefel's excellent book on JMS) and learn more about EJB transactions with JMS. Basically, in your Message Driven Bean, when the FTP fails, you will do a setRollbackOnly() and the message will be returned to the queue.
Kyle
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic