@ProviderType public interface DirectMessageReceiverBuilder extends MessageReceiverBuilder, DirectReceiverBackPressureConfiguration
DirectMessageReceiver
.
This API expected to be thread safe.
Modifier and Type | Method and Description |
---|---|
DirectMessageReceiver |
build()
Creates a new instance of
DirectMessageReceiver based on the provided configuration, to
be used in applications when distribution of messages among different application instances for
horizontal scalability purposes does not matter. |
DirectMessageReceiver |
build(ShareName shareName)
Creates a new instance of
DirectMessageReceiver to be used in applications designed
with horizontal scalability in mind with more than one instance running. |
DirectMessageReceiverBuilder |
fromProperties(Properties configuration)
Enables property-based configuration.
|
DirectMessageReceiverBuilder |
onBackPressureDropLatest(int bufferCapacity)
The Configuration for back-pressure with a specified number of pre-buffered received messages.
|
DirectMessageReceiverBuilder |
onBackPressureDropOldest(int bufferCapacity)
The Configuration for back-pressure with a specified number of pre-buffered received messages.
|
DirectMessageReceiverBuilder |
onBackPressureElastic()
The configuration for back-pressure with an elastic, unlimited capacity buffer.
|
DirectMessageReceiverBuilder |
withSubscriptions(TopicSubscription... subscriptions)
A
TopicSubscription can be added to the message receiver before the receiver is
started. |
DirectMessageReceiver build() throws PubSubPlusClientException
DirectMessageReceiver
based on the provided configuration, to
be used in applications when distribution of messages among different application instances for
horizontal scalability purposes does not matter. ALL messages matching configured TopicSubscription
will be routed to the message receiver instance. It does not matter if
application scaled horizontally and there is more than one instance running; all messages will
be routed to all receiver based on configured topic subscriptions.PubSubPlusClientException
- if the receiver instance cannot be built due to invalid
properties or invalid configurationDirectMessageReceiver build(ShareName shareName) throws PubSubPlusClientException
DirectMessageReceiver
to be used in applications designed
with horizontal scalability in mind with more than one instance running.
This method should be used when more then one instance of the application is running for horizontal scaling and messages should be distributed among different instances
shareName
- he share name describes a group of receiver to an identical set of topic
subscriptions, expected not to be null or name not to be emptyPubSubPlusClientException
- if the receiver instance cannot be built due to invalid
properties or invalid configurationDirectMessageReceiverBuilder fromProperties(Properties configuration) throws IllegalArgumentException
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
IllegalArgumentException
- if invalid properties were specifiedDirectMessageReceiverBuilder onBackPressureDropLatest(int bufferCapacity)
DirectReceiverBackPressureConfiguration
onBackPressureDropLatest
in interface DirectReceiverBackPressureConfiguration
bufferCapacity
- the maximum number of messages in a buffer; a value '>' 0 is
permittedDirectMessageReceiverBuilder onBackPressureDropOldest(int bufferCapacity)
DirectReceiverBackPressureConfiguration
onBackPressureDropOldest
in interface DirectReceiverBackPressureConfiguration
bufferCapacity
- the maximum number of messages in a buffer; a value '>' 0 is
permittedDirectMessageReceiverBuilder onBackPressureElastic()
DirectReceiverBackPressureConfiguration
onBackPressureElastic
in interface DirectReceiverBackPressureConfiguration
DirectMessageReceiverBuilder 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.