As with other WebSphere MQ Everyplace queues, it is possible to get and browse messages from WebSphere MQ-bridge queues. It is also possible to specify an MQeFields filter on these operations. If a filter is used, the first message matching the filter is returned by getMessage) and all messages matching the filter are returned by browseMessages.
When browsing messages, if the filter field is blank or null, all messages are collected from the WebSphere MQ queue and are placed in the returning enumeration. If the filter is non-blank and non-null, all messages collected from the WebSphere MQ queue are passed through the queue's message transformer before being matched against the filter. Matching messages are placed in the returning enumeration.
If the filter field contains one or both of MQE_MSG_MSGID and MQE_MSG_CORRELID, messages are collected from the WebSphere MQ queue using one or both of the WebSphere MQ MQE_MSG_MSGID and MQE_MSG_CORRELID as filter elements. The results are then transformed into WebSphere MQ Everyplace messages which are filtered as follows:
Note that using a blank or null filter, or a filter that contains neither the MQE_MSG_MSGID field nor the MQE_MSG_CORRELID field causes all messages on the WebSphere MQ queue to be browsed. To optimize performance, try to include in the filter one or both of the expected Message Id or CorrelId as it exists in WebSphere MQ format.
Filters on getMessage work in a similar way to filters on browseMessages, except that only the first match is removed from the WebSphere MQ queue and returned to the application.