public interface Browser
After being browsed, messages are still available for consumption over normal flows. However, it is possible to selectively remove messages from the persistent store of an Endpoint. In this case, these removed messages will no longer be available for consumption.
Note: If browsing a queue with an active consumer, no guarantee is made that the browser will receive all messages published to the queue. The consumer can receive and acknowledge messages before they are delivered to the browser.
One typical application is to use Browsers to allow message bus administrators to remove “stuck” Guaranteed messages from an Endpoint without having to modify or disrupt existing applications. A message can get stuck if:
Queue
. Note
that the delivery restrictions imposed by the queue’s Access type (exclusive
or non-exclusive), do not apply when browsing messages with a Browser.
Modifier and Type | Method and Description |
---|---|
void |
close()
Closes the Browser.
|
BytesXMLMessage |
getNext()
Retrieve the next message from the Browser's local message buffer, if one
is available, waiting if necessary up to the timeout configured in
BrowserProperties . |
BytesXMLMessage |
getNext(int timeoutInMillis)
Retrieve the next message from the Browser's local message buffer, if one
is available, waiting if necessary up to
timeoutInMillis ms. |
BytesXMLMessage |
getNextNoWait()
If there is at least one message available in the Browser's local message
buffer, return it immediately; otherwise, return null.
|
boolean |
hasMore()
Returns true if there is at least one message available in the Browser's
local message buffer.
|
void |
remove(BytesXMLMessage message)
Remove a message from the appliance's Queue Endpoint.
|
void close()
boolean hasMore() throws JCSMPException
Browser.hasMore()
or
Browser.getNext()
might return true and a message respectively.JCSMPException
- on errorBytesXMLMessage getNext() throws JCSMPException
BrowserProperties
.
If you want to wait indefinitely, use Browser.getNext(int)
with a
timeoutInMillis of 0.null
, if timed out.JCSMPException
- on errorBytesXMLMessage getNext(int timeoutInMillis) throws JCSMPException
timeoutInMillis
ms.
Browser.close()
.timeoutInMillis
- Time to wait for a message.null
, if timed out.JCSMPException
- on errorBytesXMLMessage getNextNoWait() throws JCSMPException
JCSMPException
- on errorvoid remove(BytesXMLMessage message) throws JCSMPException
message
- Message to remove from the Endpoint.JCSMPException
- on errorCopyright 2004-2024 Solace Corporation. All rights reserved.