| Constructor and Description |
|---|
SenderOptions() |
| Modifier and Type | Method and Description |
|---|---|
SenderOptions |
channelCloseHandler(BiConsumer<SignalType,com.rabbitmq.client.Channel> channelCloseHandler)
Set the channel closing logic.
|
SenderOptions |
channelMono(Mono<? extends com.rabbitmq.client.Channel> channelMono)
Sets the channel mono to use in send methods.
|
SenderOptions |
channelPool(ChannelPool channelPool)
Set the channel pool to use to send messages.
|
SenderOptions |
connectionClosingTimeout(Duration connectionClosingTimeout)
Timeout for closing the
Sender connection. |
SenderOptions |
connectionFactory(com.rabbitmq.client.ConnectionFactory connectionFactory) |
SenderOptions |
connectionMono(Mono<? extends com.rabbitmq.client.Connection> connectionMono)
|
SenderOptions |
connectionMonoConfigurator(Function<Mono<? extends com.rabbitmq.client.Connection>,Mono<? extends com.rabbitmq.client.Connection>> connectionMonoConfigurator)
|
SenderOptions |
connectionSubscriptionScheduler(Scheduler connectionSubscriptionScheduler)
Scheduler used on connection creation subscription.
|
SenderOptions |
connectionSupplier(com.rabbitmq.client.ConnectionFactory connectionFactory,
Utils.ExceptionFunction<com.rabbitmq.client.ConnectionFactory,? extends com.rabbitmq.client.Connection> function)
Set a callback that will be passed in the given
ConnectionFactory to create a Connection. |
SenderOptions |
connectionSupplier(Utils.ExceptionFunction<com.rabbitmq.client.ConnectionFactory,? extends com.rabbitmq.client.Connection> function)
Set a callback that will be passed in the
ConnectionFactory of this SenderOptions instance to create a Connection. |
BiConsumer<SignalType,com.rabbitmq.client.Channel> |
getChannelCloseHandler()
Returns the channel closing logic.
|
Mono<? extends com.rabbitmq.client.Channel> |
getChannelMono()
Returns the channel mono to use in send methods.
|
Duration |
getConnectionClosingTimeout() |
com.rabbitmq.client.ConnectionFactory |
getConnectionFactory() |
Mono<? extends com.rabbitmq.client.Connection> |
getConnectionMono() |
Function<Mono<? extends com.rabbitmq.client.Connection>,Mono<? extends com.rabbitmq.client.Connection>> |
getConnectionMonoConfigurator() |
Scheduler |
getConnectionSubscriptionScheduler() |
Utils.ExceptionFunction<com.rabbitmq.client.ConnectionFactory,? extends com.rabbitmq.client.Connection> |
getConnectionSupplier() |
Mono<? extends com.rabbitmq.client.Channel> |
getResourceManagementChannelMono() |
Scheduler |
getResourceManagementScheduler() |
SenderOptions |
resourceManagementChannelMono(Mono<? extends com.rabbitmq.client.Channel> resourceManagementChannelMono) |
SenderOptions |
resourceManagementScheduler(Scheduler resourceManagementScheduler)
Resource management scheduler.
|
public com.rabbitmq.client.ConnectionFactory getConnectionFactory()
public SenderOptions connectionFactory(com.rabbitmq.client.ConnectionFactory connectionFactory)
public SenderOptions resourceManagementScheduler(@Nullable Scheduler resourceManagementScheduler)
resourceManagementScheduler - SenderOptions instancepublic SenderOptions connectionSubscriptionScheduler(@Nullable Scheduler connectionSubscriptionScheduler)
connectionSubscriptionScheduler - SenderOptions instancepublic SenderOptions connectionSupplier(Utils.ExceptionFunction<com.rabbitmq.client.ConnectionFactory,? extends com.rabbitmq.client.Connection> function)
ConnectionFactory of this SenderOptions instance to create a Connection.
Note the created connection will be used by a Sender instance, which will cache it for re-use in its operations
and close it when Sender.close() is called.
function - callback to create a ConnectionSenderOptions instancepublic SenderOptions connectionSupplier(com.rabbitmq.client.ConnectionFactory connectionFactory, Utils.ExceptionFunction<com.rabbitmq.client.ConnectionFactory,? extends com.rabbitmq.client.Connection> function)
ConnectionFactory to create a Connection.
Note the created connection will be used by a Sender instance, which will cache it for re-use in its operations
and close it when Sender.close() is called.
connectionFactory - the ConnectionFactory passed-in to the creation functionfunction - callback to create a ConnectionSenderOptionspublic SenderOptions connectionMono(@Nullable Mono<? extends com.rabbitmq.client.Connection> connectionMono)
Mono that the created Sender will use for its operations.
A Sender created from this SenderOptions instance will not cache for re-use, nor close
on Sender.close() the underlying connection. It is recommended that the passed-in Mono handles
caching of some sort to avoid a new connection to be created every time the Sender does an operation.
It is the developer's responsibility to close the underlying Connection once the Sender is closed
and no longer needs it.
connectionMono - SenderOptions@Nullable public Mono<? extends com.rabbitmq.client.Connection> getConnectionMono()
public SenderOptions channelMono(@Nullable Mono<? extends com.rabbitmq.client.Channel> channelMono)
channelMono - the channel mono to useSenderOptions instance@Nullable public Mono<? extends com.rabbitmq.client.Channel> getChannelMono()
@Nullable public BiConsumer<SignalType,com.rabbitmq.client.Channel> getChannelCloseHandler()
public SenderOptions channelCloseHandler(@Nullable BiConsumer<SignalType,com.rabbitmq.client.Channel> channelCloseHandler)
channelCloseHandler - the closing logicSenderOptions instancepublic SenderOptions channelPool(ChannelPool channelPool)
channelPool - SenderOptions instancepublic SenderOptions connectionMonoConfigurator(Function<Mono<? extends com.rabbitmq.client.Connection>,Mono<? extends com.rabbitmq.client.Connection>> connectionMonoConfigurator)
Function to customize the connection Mono used in the created Sender instance.
This function can be used to configure retry when obtaining the Connection.
This function is not applied if a custom connectionMono is provided. It is applied
when a connectionSupplier is provided though.
connectionMonoConfigurator - the function to configure the passed-in connection monopublic SenderOptions resourceManagementChannelMono(@Nullable Mono<? extends com.rabbitmq.client.Channel> resourceManagementChannelMono)
@Nullable public Mono<? extends com.rabbitmq.client.Channel> getResourceManagementChannelMono()
@Nullable public Utils.ExceptionFunction<com.rabbitmq.client.ConnectionFactory,? extends com.rabbitmq.client.Connection> getConnectionSupplier()
public Function<Mono<? extends com.rabbitmq.client.Connection>,Mono<? extends com.rabbitmq.client.Connection>> getConnectionMonoConfigurator()
public SenderOptions connectionClosingTimeout(@Nullable Duration connectionClosingTimeout)
Sender connection.
Default is 30 seconds. Use Duration.ZERO for no timeout.
connectionClosingTimeout - timeout for connection closingSenderOptions instance