@ProviderType public interface MessageQueueBrowser extends MessageReceiver
After being browsed, messages are still available for consumption over normal persistent receiver. 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 message 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.
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.
MessageReceiver.FailedReceiveEvent, MessageReceiver.InboundMessageSupplier, MessageReceiver.MessageHandler, MessageReceiver.ReceiveFailureListener
LifecycleControl.TerminationEvent, LifecycleControl.TerminationNotificationListener
ManageableReceiver.DirectReceiverInfo, ManageableReceiver.PersistentReceiverInfo
Modifier and Type | Method and Description |
---|---|
InboundMessage |
receiveMessage()
Blocking request to receive a next message from a message browser without removing them from a
persistent store of Queue Endpoints.
|
InboundMessage |
receiveMessage(long timeOut)
Blocking request to receive a next message from a message browser without removing them from a
persistent store of Queue Endpoints.
|
InboundMessage |
receiveOrElse(MessageReceiver.InboundMessageSupplier supplierOfAlternativeResponse)
Request to receive a next message from a message browser without removing them from a
persistent store of Queue Endpoints.
|
void |
remove(InboundMessage message)
Request to remove a message from the PubSubPlus broker's Queue Endpoint.
|
MessageQueueBrowser |
start()
Enables service regular duties.
|
<MessageQueueBrowser> |
startAsync()
Asynchronously starts service for consuming/publishing operations.
|
setReceiveFailureListener
isRunning, isTerminated, isTerminating, setTerminationNotificationListener, terminate
startAsync, terminateAsync, terminateAsync
receiverInfo
InboundMessage receiveMessage() throws PubSubPlusClientException, PubSubPlusClientException.RequestInterruptedException
PubSubPlusClientException
- when message could not be received for an internal reasonPubSubPlusClientException.RequestInterruptedException
- when thread was interrupted while waiting for a next
message. An interrupted flag is expected to be set on a
thread in this caseInboundMessage receiveMessage(long timeOut) throws PubSubPlusClientException, PubSubPlusClientException.RequestInterruptedException
timeOut
- time out in milliseconds after that blocking receive exits, values >
0 are expected, use receiveOrElse (..)
method when immediate response is
requirednull
after time out occursPubSubPlusClientException
- when message could not be received for an internal reasonPubSubPlusClientException.RequestInterruptedException
- when thread was interrupted while waiting for a next
message. An interrupted flag is expected to be set on a
thread in this caseInboundMessage receiveOrElse(MessageReceiver.InboundMessageSupplier supplierOfAlternativeResponse)
supplierOfAlternativeResponse
- the alternative response if no new message is availablevoid remove(InboundMessage message) throws PubSubPlusClientException
Note: If browsing a queue with an active message consumer, no guarantee is made that message removal removes a message before another consumer received it
message
- a message to be removed from the PubSubPlus broker's Queue EndpointPubSubPlusClientException
- when message could not be tried to be removed for an internal
reasonMessageQueueBrowser start() throws PubSubPlusClientException, IllegalStateException
LifecycleControl
start
in interface LifecycleControl
start
in interface MessageReceiver
PubSubPlusClientException
- if the instance fails to start for some internal reasonIllegalStateException
- if the instance was previously terminated, being terminated,
or the method has been invoked at an illegal or at an
inappropriate time for some another reason<MessageQueueBrowser> CompletableFuture<MessageQueueBrowser> startAsync() throws PubSubPlusClientException, IllegalStateException
AsyncLifecycleControl
This method is an idempotent operation when no another connect/disconnect operation is ongoing.
startAsync
in interface AsyncLifecycleControl
startAsync
in interface MessageReceiver
PubSubPlusClientException
- if the messaging service will not start in the futureIllegalStateException
- if the method has been invoked at an illegal or inappropriate
timeCopyright 2019-2024 Solace Corporation. All rights reserved.