For IBM MQ it is possible to use MQGET to browse messages on a queue (https://www.ibm.com/docs/en/ibm-mq/9.2?topic=queue-browsing-messages) or just do a ‘normal’ MQGET (https://www.ibm.com/docs/en/ibm-mq/9.2?topic=queue-getting-messages-from-using-mqget-call)
I cannot find any differences in what a browse does (except using a cursor) and a normal get does, in terms of what content is being retrieved.
Am I missing something here?
>Solution :
In general a normal get is destructive and the message is permanently removed from the queue, a browse is not deductive and does not remove the message from the queue. The message content returned is the same in either case.
There are three basic situations:
-
A get with the browse option does not remove the message from the queue, it is still available for other consumers to get or browse from the queue.
-
A normal get outside of a unit of work will remove the message from the queue, it will not be available for other consumers to get or browse from the queue.
-
A normal get inside of a unit of work will make the message unavailable for other consumers to get or browse from the queue.
- If the unit of work is committed the message will be removed from the queue, it will not be available for other consumers to get or browse from the queue.
- If the unit of work is backed out the message will be available again for other consumers to get or browse from the queue.