| Constructor and Description |
|---|
ReceiverOptions() |
public ConnectionFactory getConnectionFactory()
public ReceiverOptions connectionFactory(ConnectionFactory connectionFactory)
public ReceiverOptions connectionSubscriptionScheduler(@Nullable Scheduler connectionSubscriptionScheduler)
connectionSubscriptionScheduler - ReceiverOptions instancepublic ReceiverOptions connectionSupplier(Utils.ExceptionFunction<ConnectionFactory,? extends Connection> function)
ConnectionFactory of this ReceiverOptions instance to create a Connection.
Note the created connection will be used by a Receiver instance, which will cache it for re-use in its operations
and close it when Receiver.close() is called.
function - callback to create a ConnectionReceiverOptions instancepublic ReceiverOptions connectionSupplier(ConnectionFactory connectionFactory, Utils.ExceptionFunction<ConnectionFactory,? extends Connection> function)
ConnectionFactory to create a Connection.
Note the created connection will be used by a Receiver instance, which will cache it for re-use in its operations
and close it when Receiver.close() is called.
connectionFactory - the ConnectionFactory passed-in to the creation functionfunction - callback to create a ConnectionReceiverOptionspublic ReceiverOptions connectionMono(@Nullable Mono<? extends Connection> connectionMono)
Mono that the created Receiver will use for its operations.
A Receiver created from this ReceiverOptions instance will not cache for re-use, nor close
on Receiver.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 Receiver does an operation.
It is the developer's responsibility to close the underlying Connection once the Receiver is closed
and no longer needs it.
connectionMono - ReceiverOptionspublic ReceiverOptions connectionMonoConfigurator(Function<Mono<? extends Connection>,Mono<? extends Connection>> connectionMonoConfigurator)
Function to customize the connection Mono used in the created Receiver 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 mono@Nullable public Mono<? extends Connection> getConnectionMono()
@Nullable public Utils.ExceptionFunction<ConnectionFactory,? extends Connection> getConnectionSupplier()
public Function<Mono<? extends Connection>,Mono<? extends Connection>> getConnectionMonoConfigurator()
public ReceiverOptions connectionClosingTimeout(@Nullable Duration connectionClosingTimeout)
Receiver connection.
Default is 30 seconds. Use Duration.ZERO for no timeout.
connectionClosingTimeout - timeout for connection closingReceiverOptions instance