@ProviderType public interface MessageReceiver extends LifecycleControl, AsyncLifecycleControl, ManageableReceiver
Modifier and Type | Interface and Description |
---|---|
static class |
MessageReceiver.FailedReceiveEvent
A class that encapsulates details of a failed attempt to receive a message.
|
static interface |
MessageReceiver.InboundMessageSupplier
An interface for message supplier functionality used for alternative message receiver methods.
|
static interface |
MessageReceiver.MessageHandler
An interface for the listener of message handlers for inbound messages.
|
static interface |
MessageReceiver.ReceiveFailureListener
An interface for a listener for failures during the receipt of messages from a broker.
|
LifecycleControl.TerminationEvent, LifecycleControl.TerminationNotificationListener
ManageableReceiver.DirectReceiverInfo, ManageableReceiver.PersistentReceiverInfo
Modifier and Type | Method and Description |
---|---|
void |
setReceiveFailureListener(MessageReceiver.ReceiveFailureListener receiveFailureListener)
Sets
ReceiveFailureListener for the given instance of the receiver. |
MessageReceiver |
start()
Enables service regular duties.
|
<MessageReceiver> |
startAsync()
Asynchronously starts service for consuming/publishing operations.
|
isRunning, isTerminated, isTerminating, setTerminationNotificationListener, terminate
startAsync, terminateAsync, terminateAsync
receiverInfo
void setReceiveFailureListener(MessageReceiver.ReceiveFailureListener receiveFailureListener)
ReceiveFailureListener
for the given instance of the receiver. It is used to
notify about failures during the message receipt.receiveFailureListener
- the listener that will be used to process message receipt
failuresMessageReceiver start() throws PubSubPlusClientException, IllegalStateException
LifecycleControl
start
in interface LifecycleControl
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<MessageReceiver> CompletableFuture<MessageReceiver> startAsync() throws PubSubPlusClientException, IllegalStateException
AsyncLifecycleControl
This method is an idempotent operation when no another connect/disconnect operation is ongoing.
startAsync
in interface AsyncLifecycleControl
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.