@ProviderType public interface PersistentMessageReceiverBuilder extends MessageReceiverBuilder, ReceiverActivationPassivationConfiguration, MessageAcknowledgementConfiguration, MessageReplayConfiguration, MissingResourcesCreationConfiguration
PersistentMessageReceiver to receive
persistent messages.
This API expected to be thread safe.
ReceiverActivationPassivationConfiguration.ReceiverStateChangeListenerMessageAcknowledgementConfiguration.OutcomeMissingResourcesCreationConfiguration.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)
MessageReceiverBuilderfromProperties in interface MessageReceiverBuilderfromProperties in interface PropertyBasedConfigurationfromProperties in interface ReceiverPropertyConfigurationconfiguration - 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 MessageReceiverBuilderPersistentMessageReceiverBuilder withActivationPassivationSupport(ReceiverActivationPassivationConfiguration.ReceiverStateChangeListener receiverStateChangeListener)
ReceiverActivationPassivationConfigurationwithActivationPassivationSupport in interface ReceiverActivationPassivationConfigurationreceiverStateChangeListener - a listener that is capable to notify about state change of a
receiver instancePersistentMessageReceiverBuilder withMessageAutoAcknowledgement()
MessageAcknowledgementConfigurationNote:
- 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 MessageAcknowledgementConfigurationPersistentMessageReceiverBuilder withMessageClientAcknowledgement()
MessageAcknowledgementConfigurationClient 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 MessageAcknowledgementConfigurationPersistentMessageReceiverBuilder withMessageReplay(ReplayStrategy replayStrategy)
MessageReplayConfigurationwithMessageReplay in interface MessageReplayConfigurationreplayStrategy - 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)
MissingResourcesCreationConfigurationMissingResourcesCreationStrategy.withMissingResourcesCreationStrategy in interface MissingResourcesCreationConfigurationstrategy - the missing resources creation strategy to be usedPersistentMessageReceiverBuilder withRequiredMessageClientOutcomeOperationSupport(MessageAcknowledgementConfiguration.Outcome... requiredOutcomes)
MessageAcknowledgementConfigurationThe 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 MessageAcknowledgementConfigurationrequiredOutcomes - if set, receiver will respect requirements provided. Start of the
receiver with older unsupported broker will be prevented.PersistentMessageReceiverBuilder withSubscriptions(TopicSubscription... subscriptions)
MessageReceiverBuilderTopicSubscription 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 MessageReceiverBuildersubscriptions - the list of topic subscriptions to addCopyright 2019-2025 Solace Corporation. All rights reserved.