@ProviderType public interface DirectMessagePublisherBuilder extends MessagePublisherBuilder
DirectMessagePublisher
to publish
direct messages.
This API expected to be thread safe.
Modifier and Type | Method and Description |
---|---|
DirectMessagePublisher |
build()
Builds a new instance of
DirectMessagePublisher based on the provided configuration. |
DirectMessagePublisherBuilder |
fromProperties(Properties configuration)
Enables property-based configuration.
|
DirectMessagePublisherBuilder |
onBackPressureElastic()
The configuration for back-pressure with an elastic, unlimited capacity buffer.
|
DirectMessagePublisherBuilder |
onBackPressureReject(int bufferCapacity)
The configuration for back-pressure with a specified number of buffered messages.
|
DirectMessagePublisherBuilder |
onBackPressureWait(int bufferCapacity)
The configuration for back-pressure with specified number of buffered messages.
|
DirectMessagePublisher build() throws PubSubPlusClientException
DirectMessagePublisher
based on the provided configuration.PubSubPlusClientException
- if a publisher for direct messages cannot be created due to
invalid properties or invalid configurationDirectMessagePublisherBuilder fromProperties(Properties configuration) throws IllegalArgumentException
MessagePublisherBuilder
fromProperties
in interface MessagePublisherBuilder
fromProperties
in interface PropertyBasedConfiguration
fromProperties
in interface PublisherPropertyConfiguration
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.PublisherProperties
for the list of MessagePublisher
properties
configurable through this MessagePublisherBuilder
IllegalArgumentException
- if invalid properties were specifiedDirectMessagePublisherBuilder onBackPressureElastic()
PublisherBackPressureConfiguration
onBackPressureElastic
in interface PublisherBackPressureConfiguration
DirectMessagePublisherBuilder onBackPressureReject(int bufferCapacity)
PublisherBackPressureConfiguration
PubSubPlusClientException.PublisherOverflowException
exception when the publishing capabilities of the API are
exceeded.onBackPressureReject
in interface PublisherBackPressureConfiguration
bufferCapacity
- the maximum number of messages that can be buffered before the strategy
fails and messages can no longer be sent over the wire. Once this number
is exceeded, the publishing of new messages is no longer possible and
exceptions are thrown until the buffer has free capacity; value > 0 is expected.DirectMessagePublisherBuilder onBackPressureWait(int bufferCapacity)
PublisherBackPressureConfiguration
bufferCapacity
causes
the publisher thread to pause.onBackPressureWait
in interface PublisherBackPressureConfiguration
bufferCapacity
- the maximum number of messages that can be buffered before the publishing
thread is pausedCopyright 2019-2024 Solace Corporation. All rights reserved.