Originally posted by Ranvir Dalal:
Is there any way in Websphere to read the message from MQ Queue in browse mode. MQI allows it, but I am not sure if JMS supports this or not?
Is there any way to achieve this in WAS via JMS?
This is needed as I want to delete the message from Queue only after I am done reading the message. As message is long in size and it would be read segment by segment and in case it fails in the middle, I need to start over from segment 1. That is possible only if I read the message in browse mode?
If you read the message in a transaction, e.g. in a message driven bean, then the read should be atomic. If it fails part the way through, the transaction will roll back and the message will still be on the queue.
You could read messages non destructively from a queue by browsing them. Check out the JMS docs. One thing to be aware of when browsing MQ queues is that there used to be a bug whereby if you didn't browse all messages a resource would not be released, and eventually you'd run out. This may well have been fixed ( it was on WebSphere MQ 5 )