WebSphere Message Service Clients for C/C++ and .NET, Version 1.2 Operating Systems: Linux, Windows

QueueBrowser

An application uses a queue browser to browse messages on a queue without removing them.

Functions

Summary of functions:
Function Description
xmsQueueBrowserClose Close the queue browser.
xmsQueueBrowserGetEnumeration Get a list of the messages on the queue.
xmsQueueBrowserGetMessageSelector Get the message selector for the queue browser.
xmsQueueBrowserGetQueue Get the queue associated with the queue browser.

xmsQueueBrowserClose – Close Queue Browser

Interface:
xmsRC xmsQueueBrowserClose(xmsHQueueBrowser *browser,
                           xmsHErrorBlock errorBlock);

Close the queue browser.

If an application tries to close a queue browser that is already closed, the call is ignored.

Parameters:
browser (input/output)
On input, the handle for the queue browser. On output, the function returns a null handle.
errorBlock (input)
The handle for an error block or a null handle.
Exceptions:
  • XMS_X_GENERAL_EXCEPTION

xmsQueueBrowserGetEnumeration – Get Messages

Interface:
xmsRC xmsQueueBrowserGetEnumeration(xmsHQueueBrowser browser,
                                    xmsHIterator *iterator,
                                    xmsHErrorBlock errorBlock);

Get a list of the messages on the queue.

The function returns an iterator that encapsulates a list of Message objects. The order of the Message objects in the list is the same as the order in which the messages would be retrieved from the queue. The application can then use the iterator to browse each message in turn.

The iterator is updated dynamically as messages are put on the queue and removed from the queue. Each time the application calls xmsIteratorGetNext() to browse the next message on the queue, the message returned reflects the current contents of the queue.

If an application calls this function more than once for a given queue browser, each call returns a new iterator. The application can therefore use more than one iterator to browse the messages on a queue and maintain multiple positions within the queue.

Parameters:
browser (input)
The handle for the queue browser.
iterator (output)
The handle for the iterator.
errorBlock (input)
The handle for an error block or a null handle.
Exceptions:
  • XMS_X_GENERAL_EXCEPTION

xmsQueueBrowserGetMessageSelector – Get Message Selector

Interface:
xmsRC xmsQueueBrowserGetMessageSelector(xmsHQueueBrowser browser,
                                        xmsCHAR *messageSelector,
                                        xmsINT length,
                                        xmsINT *actualLength,
                                        xmsHErrorBlock errorBlock);

Get the message selector for the queue browser.

For more information about how to use this function, see C functions that return a string by value.

Parameters:
browser (input)
The handle for the queue browser.
messageSelector (output)
The buffer to contain the message selector expression. If data conversion is required, this is the message selector expression after conversion.
length (input)
The length of the buffer in bytes. If you specify XMSC_QUERY_SIZE instead, the message selector expression is not returned, but its length is returned in the actualLength parameter.
actualLength (output)
The length of the message selector expression in bytes. If data conversion is required, this is the length of the message selector expression after conversion. If you specify a null pointer on input, the length is not returned.
errorBlock (input)
The handle for an error block or a null handle.
Exceptions:
  • XMS_X_GENERAL_EXCEPTION

xmsQueueBrowserGetQueue – Get Queue

Interface:
xmsRC xmsQueueBrowserGetQueue(xmsHQueueBrowser browser,
                              xmsHDest *queue,
                              xmsHErrorBlock errorBlock);

Get the queue associated with the queue browser.

Parameters:
browser (input)
The handle for the queue browser.
queue (output)
The handle for a Destination object representing the queue.
errorBlock (input)
The handle for an error block or a null handle.
Exceptions:
  • XMS_X_GENERAL_EXCEPTION

Reference topic

Terms of Use | Rate this page

Last updated: 7 Dec 2005

© Copyright IBM Corporation 2005. All Rights Reserved.