public interface ChannelPool
extends io.micronaut.core.naming.Named
Channel
s to allow for channels to be shared across
threads but not at the same time. A channel retrieved from the pool should
not be accessible to any other threads until the channel is returned from
the pool.Modifier and Type | Field and Description |
---|---|
static int |
DEFAULT_RECOVERY_DELAY
The default delay to apply for recovery channel getter.
|
Modifier and Type | Method and Description |
---|---|
com.rabbitmq.client.Channel |
getChannel()
Retrieves a channel from the pool.
|
default com.rabbitmq.client.Channel |
getChannelWithRecoveringDelay(int recoveryAttempts)
Retrieves a channel from the pool after blocking the thread for a delay period defined by the
RecoveryDelayHandler
of the connection for this pool. |
default boolean |
isTopologyRecoveryEnabled()
Returns whether
topology recovery
is enabled for the connection of this pool. |
void |
returnChannel(com.rabbitmq.client.Channel channel)
Returns a channel to the pool.
|
static final int DEFAULT_RECOVERY_DELAY
com.rabbitmq.client.Channel getChannel() throws java.io.IOException
java.io.IOException
- If a channel needed to be created and encountered an errordefault com.rabbitmq.client.Channel getChannelWithRecoveringDelay(int recoveryAttempts) throws java.io.IOException, java.lang.InterruptedException
RecoveryDelayHandler
of the connection for this pool.recoveryAttempts
- the number of recovery attempts so farjava.io.IOException
- if a channel needed to be created and encountered an errorjava.lang.InterruptedException
- if the thread was interrupted during the delay perioddefault boolean isTopologyRecoveryEnabled()
topology recovery
is enabled for the connection of this pool.void returnChannel(com.rabbitmq.client.Channel channel)
channel
- The channel