Constructor and Description |
---|
SenderOptions() |
public ConnectionFactory getConnectionFactory()
public SenderOptions connectionFactory(ConnectionFactory connectionFactory)
public SenderOptions resourceManagementScheduler(@Nullable Scheduler resourceManagementScheduler)
resourceManagementScheduler
- SenderOptions
instancepublic SenderOptions connectionSubscriptionScheduler(@Nullable Scheduler connectionSubscriptionScheduler)
connectionSubscriptionScheduler
- SenderOptions
instancepublic SenderOptions connectionSupplier(Utils.ExceptionFunction<ConnectionFactory,? extends 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 Connection
SenderOptions
instancepublic SenderOptions connectionSupplier(ConnectionFactory connectionFactory, Utils.ExceptionFunction<ConnectionFactory,? extends 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 Connection
SenderOptions
public SenderOptions connectionMono(@Nullable Mono<? extends 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 Connection> getConnectionMono()
public SenderOptions channelMono(@Nullable Mono<? extends Channel> channelMono)
channelMono
- the channel mono to useSenderOptions
instance@Nullable public Mono<? extends Channel> getChannelMono()
@Nullable public BiConsumer<SignalType,Channel> getChannelCloseHandler()
public SenderOptions channelCloseHandler(@Nullable BiConsumer<SignalType,Channel> channelCloseHandler)
channelCloseHandler
- the closing logicSenderOptions
instancepublic SenderOptions channelPool(ChannelPool channelPool)
channelPool
- SenderOptions
instancepublic SenderOptions connectionMonoConfigurator(Function<Mono<? extends Connection>,Mono<? extends 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 Channel> resourceManagementChannelMono)
@Nullable public Mono<? extends Channel> getResourceManagementChannelMono()
@Nullable public Utils.ExceptionFunction<ConnectionFactory,? extends Connection> getConnectionSupplier()
public Function<Mono<? extends Connection>,Mono<? extends 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