@ProviderType public interface PersistentMessageReceiverBuilder extends MessageReceiverBuilder, ReceiverActivationPassivationConfiguration, MessageAcknowledgementConfiguration, MessageReplayConfiguration, MissingResourcesCreationConfiguration
PersistentMessageReceiver
to receive
persistent messages.
This API expected to be thread safe.
ReceiverActivationPassivationConfiguration.ReceiverStateChangeListener
MessageAcknowledgementConfiguration.Outcome
MissingResourcesCreationConfiguration.MissingResourcesCreationStrategy
Modifier and Type | Method and Description |
---|---|
PersistentMessageReceiver |
build(Queue endpointToConsumeFrom)
Creates an instance of
PersistentMessageReceiver . |
PersistentMessageReceiverBuilder |
fromProperties(Properties configuration)
Enables property-based configuration.
|
PersistentMessageReceiverBuilder |
withActivationPassivationSupport(ReceiverActivationPassivationConfiguration.ReceiverStateChangeListener receiverStateChangeListener)
Configures a callback to receive notifications from the broker about state changes regarding a
given receiver instance.
|
PersistentMessageReceiverBuilder |
withMessageAutoAcknowledgement()
Enables support for message Auto-Acknowledgement (auto-ack) for persistent message receiver.
|
PersistentMessageReceiverBuilder |
withMessageClientAcknowledgement()
Enables support for client message acknowledgement on persistent message receiver.
|
PersistentMessageReceiverBuilder |
withMessageReplay(ReplayStrategy replayStrategy)
Enables support for message replay using a specific replay strategy.
|
PersistentMessageReceiverBuilder |
withMessageSelector(String selectorQueryExpression)
Enables support for message selection based on message header parameter and message properties
values.
|
PersistentMessageReceiverBuilder |
withMissingResourcesCreationStrategy(MissingResourcesCreationConfiguration.MissingResourcesCreationStrategy strategy)
Provides a framework to configure the missing resources creation strategy using a given
instance of
MissingResourcesCreationStrategy . |
PersistentMessageReceiverBuilder |
withRequiredMessageClientOutcomeOperationSupport(MessageAcknowledgementConfiguration.Outcome... requiredOutcomes)
Enables required support for all specified settlement options
|
PersistentMessageReceiverBuilder |
withSubscriptions(TopicSubscription... subscriptions)
A
TopicSubscription can be added to the message receiver before the receiver is
started. |
PersistentMessageReceiver build(Queue endpointToConsumeFrom) throws PubSubPlusClientException
PersistentMessageReceiver
.endpointToConsumeFrom
- a queue for message consumption; use factory methods in Queue
interface to create queues for particular purpose (shared
or exclusive, durable or non durable)PubSubPlusClientException
- if the receiver instance cannot be built due to invalid
properties or invalid configurationPersistentMessageReceiverBuilder fromProperties(Properties configuration)
MessageReceiverBuilder
fromProperties
in interface MessageReceiverBuilder
fromProperties
in interface PropertyBasedConfiguration
fromProperties
in interface ReceiverPropertyConfiguration
configuration
- the properties (key of type String
and value of type String
) for configuration and fine-tuning. Common properties can be found
in SolaceProperties
and its sub-interfaces. Refer the SolaceProperties.ReceiverProperties
for the list of MessageReceiver
properties
configurable through this MessageReceiverBuilder
PersistentMessageReceiverBuilder withActivationPassivationSupport(ReceiverActivationPassivationConfiguration.ReceiverStateChangeListener receiverStateChangeListener)
ReceiverActivationPassivationConfiguration
withActivationPassivationSupport
in interface ReceiverActivationPassivationConfiguration
receiverStateChangeListener
- a listener that is capable to notify about state change of a
receiver instancePersistentMessageReceiverBuilder withMessageAutoAcknowledgement()
MessageAcknowledgementConfiguration
Note:
- For messages received on callback based methods, auto-ack is performed when the message-processing callback method finishes without an error. This means that if the message-processing callback method decides to process messages using another thread, message acknowledgement may be performed before another thread finishes, and any exceptions thrown in the other thread won't be considered.
- For messages received on a blocking receive methods (without callback), auto-ack is
performed immediately when the message is passed to the receive (..)
method.
Caution is required if this method is used in conjunction with MessageAcknowledgementConfiguration.withRequiredMessageClientOutcomeOperationSupport(Outcome...)
.
See provided javadoc for more details
withMessageAutoAcknowledgement
in interface MessageAcknowledgementConfiguration
PersistentMessageReceiverBuilder withMessageClientAcknowledgement()
MessageAcknowledgementConfiguration
Client message acknowledgement is default behaviour, and this method's purpose is to switch back to client acknowledgement after auto-ack was turned on.
withMessageClientAcknowledgement
in interface MessageAcknowledgementConfiguration
PersistentMessageReceiverBuilder withMessageReplay(ReplayStrategy replayStrategy)
MessageReplayConfiguration
withMessageReplay
in interface MessageReplayConfiguration
replayStrategy
- the replay strategy to usePersistentMessageReceiverBuilder withMessageSelector(String selectorQueryExpression)
Syntax of the expression is based on a subset of the SQL92 conditional expression syntax. For syntax https://docs.oracle.com/en/database/oracle/oracle-database/20/jajms/javax/jms/Message.html.
selectorQueryExpression
- uses JMS like syntax for message selector query expressionPersistentMessageReceiverBuilder withMissingResourcesCreationStrategy(MissingResourcesCreationConfiguration.MissingResourcesCreationStrategy strategy)
MissingResourcesCreationConfiguration
MissingResourcesCreationStrategy
.withMissingResourcesCreationStrategy
in interface MissingResourcesCreationConfiguration
strategy
- the missing resources creation strategy to be usedPersistentMessageReceiverBuilder withRequiredMessageClientOutcomeOperationSupport(MessageAcknowledgementConfiguration.Outcome... requiredOutcomes)
MessageAcknowledgementConfiguration
The default value is: Outcome.ACCEPTED
.
Enable of negative message settlement options is required to prepare the receiver to work
with any of negative message settlement options such as Outcome.FAILED
or Outcome.REJECTED
Usage this configuration option in conjunction with Outcome.FAILED and Outcome.REJECTED
is mutually exclusive with MessageAcknowledgementConfiguration.withMessageAutoAcknowledgement()
withRequiredMessageClientOutcomeOperationSupport
in interface MessageAcknowledgementConfiguration
requiredOutcomes
- if set, receiver will respect requirements provided. Start of the
receiver with older unsupported broker will be prevented.PersistentMessageReceiverBuilder withSubscriptions(TopicSubscription... subscriptions)
MessageReceiverBuilder
TopicSubscription
can be added to the message receiver before the receiver is
started. It is also possible to add topic subscriptions at later time before or after receiver
is started. When topic subscriptions are successfully added, the receiver is expected to
receive messages that are sent to the matching topic subscriptions.withSubscriptions
in interface MessageReceiverBuilder
subscriptions
- the list of topic subscriptions to addCopyright 2019-2024 Solace Corporation. All rights reserved.