aspose file tools*
The moose likes EJB and other Java EE Technologies and the fly likes MQ rollback Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » EJB and other Java EE Technologies
Bookmark "MQ rollback" Watch "MQ rollback" New topic
Author

MQ rollback

Naveen Sampra
Ranch Hand

Joined: Jun 11, 2003
Posts: 70
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

Joined: Feb 28, 2003
Posts: 227
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

Joined: Aug 10, 2001
Posts: 3892
    
    5
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


Kyle Brown, Author of Persistence in the Enterprise and Enterprise Java Programming with IBM Websphere, 2nd Edition
See my homepage at http://www.kyle-brown.com/ for other WebSphere information.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: MQ rollback