Browse

You can browse queues for messages using a filter, for example message ID or priority . Browsing retrieves all the messages that match the filter, but leaves them on the queue. The queue can belong to a local or remote queue manager.

MQe also supports Browsing under lock. This allows you to lock the matching messages on the queue. You can lock messages individually, or in groups identified through a filter, and the locking operation returns a lockID. Use the lockID to get or delete messages. An option on browse allows you to return either the full messages, or only the UniqueIDs.
  MQeVectorHndl hListMsgs;
  
  rc = mqeQueueManager_browseMessages(hQueueManager,
                                      &exceptBlock,
                                      &hListMsgs,
                                      hQMName,
                                      hQueueName,
                                      hFilter,
                                     NULL,MQE_FALSE);
if (MQERETURN_OK == rc) {
    /* process list using mqeVector_* apis */

    /* free off the vector */
    rc = mqeVector_free(hListMsgs,&exceptBlock);
}

Returning an entire collection of messsages can be expensive in terms of system resources. Setting the justUID parameter to true and returns the uniqueID of each message that matches the filter only.

The messages returned in the collection are still visible to other MQe APIs. Therefore, when performing subsequent operations on the messages contained in the enumeration, the application must be aware that another application can process these messages once the collection is returned. To prevent other applications from processing messages, use the browseMessagesAndLock method to lock messages contained in the enumeration.


Terms of use | WebSphere software

(c) Copyright IBM Corporation 2004, 2005. All rights reserved.