Extending the Browsing WebSphere MQ Queues sample

You can extend the sample to learn more about browsing WebSphere MQ queues. Use the following instructions to find out how you can extend the sample.

Improving performance when removing a browsed message

In the BrowseGet message flow, an MQGet node was used to remove the browsed message from the input queue, when the staff number was equal to 2. By using the default node options, the input message is read and parsed for both the browse and the get operations. Because the original message has not been modified between the browse and the get operation, the re-parsing is unnecessary. Set the following properties on the MQGet node:

The results of making these changes to the properties:

Checking if the message was browsed

It might be possible to ascertain whether the input message was browsed or removed from the design of your message flow. However, in some circumstances it might not be possible to tell if the message was browsed. An attempt to remove a message which has already been removed is a redundant step that involves using an MQGet node to propagate the message to the NoMsg terminal.

You can add the following check before entering the MQGet node to determine if the message has already been browsed:

LocalEnvironment.MQ.GET.Browsed = TRUE

The LocalEnvironment.MQ.GET.Browsed field is not present for messages that have not yet been browsed.

Re-browsing messages

You might want the MQInput node to return to the start of the input queue and browse from the beginning, because you want to re-browse the messages, or because some messages were previously missed. For example, messages can be missed if the queue has MsgDeliverySequence set to MQMDS_PRIORITY, and a message arrives on the queue that is of a higher priority than the one currently pointed to by the browse cursor.

Set the Reset browse timeout (ms) property of the MQInput node to be a positive interval in milliseconds. If no new messages arrive on the input queue during this time interval the MQInput node begins browsing from the start of the queue.

If you still have staffmsg1 messages on the queue, they are re-browsed. You cannot see that the messages are re-browsed unless you modify the flow to process them.

Back to sample home