@ProviderType public interface PersistentMessagePublisherBuilder extends MessagePublisherBuilder
PersistentMessagePublisher
to send
persistent messages.
This API expected to be thread safe.
Modifier and Type | Method and Description |
---|---|
PersistentMessagePublisher |
build()
Creates an instance of
PersistentMessagePublisher . |
PersistentMessagePublisherBuilder |
fromProperties(Properties configuration)
Enables property-based configuration.
|
PersistentMessagePublisherBuilder |
onBackPressureElastic()
The configuration for back-pressure with an elastic, unlimited capacity buffer.
|
PersistentMessagePublisherBuilder |
onBackPressureReject(int bufferCapacity)
The configuration for back-pressure with a specified number of buffered messages.
|
PersistentMessagePublisherBuilder |
onBackPressureWait(int bufferCapacity)
The configuration for back-pressure with specified number of buffered messages.
|
PersistentMessagePublisherBuilder |
withDeliveryAckTimeout(int timeout)
Provides an option to configure a message delivery acknowledgement timeout.
|
PersistentMessagePublisherBuilder |
withDeliveryAckWindowSize(int windowSize)
Provides an option to configure a maximum number of messages the application can send before
the Solace API must receive an acknowledgment from broker.
|
PersistentMessagePublisher build() throws PubSubPlusClientException
PersistentMessagePublisher
.PersistentMessagePublisher
PubSubPlusClientException
- if a publisher for persistent messages cannot be created due
to invalid properties or invalid configurationPersistentMessagePublisherBuilder fromProperties(Properties configuration)
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
PersistentMessagePublisherBuilder onBackPressureElastic()
PublisherBackPressureConfiguration
onBackPressureElastic
in interface PublisherBackPressureConfiguration
PersistentMessagePublisherBuilder 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.PersistentMessagePublisherBuilder 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 pausedPersistentMessagePublisherBuilder withDeliveryAckTimeout(int timeout) throws IllegalArgumentException
timeout
- the delivery acknowledgement timeout value in milliseconds. The valid range is
20-60000.IllegalArgumentException
- if timeout is out of rangePersistentMessagePublisherBuilder withDeliveryAckWindowSize(int windowSize) throws IllegalArgumentException
windowSize
- window size in messages. The valid range is 1-255.IllegalArgumentException
- if window size is out of rangeCopyright 2019-2024 Solace Corporation. All rights reserved.