public class Config extends Object implements ConnectionConfig
| Constructor and Description |
|---|
Config() |
Config(Config parent)
Creates a new Config object that inherits configuration from the
parent. |
| Modifier and Type | Method and Description |
|---|---|
Collection<ChannelListener> |
getChannelListeners()
Returns the channel's listeners else empty list if none were configured.
|
RecoveryPolicy |
getChannelRecoveryPolicy()
Returns the channel's recovery policy.
|
RetryPolicy |
getChannelRetryPolicy()
Returns the channel's retry policy.
|
Collection<ConnectionListener> |
getConnectionListeners()
Returns the connection's listeners else empty list if none were configured.
|
RecoveryPolicy |
getConnectionRecoveryPolicy()
Returns the connection's recovery policy.
|
RetryPolicy |
getConnectionRetryPolicy()
Returns the connection's retry policy.
|
RetryPolicy |
getConnectRetryPolicy()
Sets the policy to use for handling
connection attempt errors. |
Collection<ConsumerListener> |
getConsumerListeners()
Returns the consumer listeners else empty list if none were configured.
|
Set<Class<? extends Exception>> |
getRecoverableExceptions()
Returns the exceptions which will be recovered from.
|
Set<Class<? extends Exception>> |
getRetryableExceptions()
Returns the exceptions for which invocations will be retried.
|
boolean |
isConsumerRecoveryEnabled()
Returns whether consumer recovery is enabled.
|
boolean |
isExchangeRecoveryEnabled()
Returns whether exchange and exchange binding recovery is enabled.
|
boolean |
isQueueRecoveryEnabled()
Returns whether queue and queue binding recovery is enabled.
|
static ConfigurableChannel |
of(com.rabbitmq.client.Channel channel)
Returns the
channel as a ConfigurableChannel. |
static ConfigurableConnection |
of(com.rabbitmq.client.Connection connection)
Returns the
connection as a ConfigurableConnection. |
Config |
withChannelListeners(ChannelListener... channelListeners)
Sets the
channelListeners to call on channel related events. |
Config |
withChannelRecoveryPolicy(RecoveryPolicy channelRecoveryPolicy)
Sets the
recoveryPolicy to use for recovering the channel. |
Config |
withChannelRetryPolicy(RetryPolicy channelRetryPolicy)
Sets the
retryPolicy to use for retrying failed invocations on the channel. |
Config |
withConnectionListeners(ConnectionListener... connectionListeners)
Sets the
connectionListeners to call on connection related events. |
Config |
withConnectionRecoveryPolicy(RecoveryPolicy connectionRecoveryPolicy)
Sets the policy to use for the recovery of Connections after an unexpected Connection closure.
|
Config |
withConnectionRetryPolicy(RetryPolicy connectionRetryPolicy)
Sets the policy to use for handling
Connection invocation errors. |
Config |
withConnectRetryPolicy(RetryPolicy connectRetryPolicy)
Sets the policy to use for handling initial
connection attempt errors. |
Config |
withConsumerListeners(ConsumerListener... consumerListeners)
Sets the
consumerListeners to call on consumer related events. |
Config |
withConsumerRecovery(boolean enabled)
Sets whether consumer recovery is enabled or not.
|
Config |
withExchangeRecovery(boolean enabled)
Sets whether exchange and exchange binding recovery is enabled or not.
|
Config |
withQueueRecovery(boolean enabled)
Sets whether queue and queue binding recovery is enabled or not.
|
Config |
withRecoveryPolicy(RecoveryPolicy recoveryPolicy)
Sets the policy to use for the recovery of Connections/Channels/Consumers after an unexpected
Connection/Channel closure.
|
Config |
withRetryPolicy(RetryPolicy retryPolicy)
Sets the policy to use for handling
connection attempt, Connection invocation, and Channel invocation errors. |
public Config()
public Config(Config parent)
parent.public static ConfigurableChannel of(com.rabbitmq.client.Channel channel)
channel as a ConfigurableChannel.IllegalArgumentException - if channel was not created by Lyrapublic static ConfigurableConnection of(com.rabbitmq.client.Connection connection)
connection as a ConfigurableConnection.IllegalArgumentException - if connection was not created by Lyrapublic Collection<ChannelListener> getChannelListeners()
ChannelConfiggetChannelListeners in interface ChannelConfigChannelConfig.withChannelListeners(ChannelListener...)public RecoveryPolicy getChannelRecoveryPolicy()
ChannelConfiggetChannelRecoveryPolicy in interface ChannelConfigChannelConfig.withChannelRecoveryPolicy(RecoveryPolicy)public RetryPolicy getChannelRetryPolicy()
ChannelConfiggetChannelRetryPolicy in interface ChannelConfigChannelConfig.withChannelRetryPolicy(RetryPolicy)public Collection<ConnectionListener> getConnectionListeners()
ConnectionConfiggetConnectionListeners in interface ConnectionConfigConnectionConfig.withConnectionListeners(ConnectionListener...)public RecoveryPolicy getConnectionRecoveryPolicy()
ConnectionConfiggetConnectionRecoveryPolicy in interface ConnectionConfigConnectionConfig.withConnectionRecoveryPolicy(RecoveryPolicy)public RetryPolicy getConnectionRetryPolicy()
ConnectionConfiggetConnectionRetryPolicy in interface ConnectionConfigConnectionConfig.withConnectionRetryPolicy(RetryPolicy)public RetryPolicy getConnectRetryPolicy()
connection attempt errors. Overrides the global retry
policy.public Collection<ConsumerListener> getConsumerListeners()
ConsumerConfiggetConsumerListeners in interface ConsumerConfigConsumerConfig.getConsumerListeners()public Set<Class<? extends Exception>> getRecoverableExceptions()
SocketTimeoutException, ConnectException, AlreadyClosedException, and
TimeoutException, but this set can be mutated directly to change the recoverable
exceptions.public Set<Class<? extends Exception>> getRetryableExceptions()
SocketTimeoutException, ConnectException, AlreadyClosedException, and
TimeoutException, but this set can be mutated directly to change the retryable
exceptions.public boolean isConsumerRecoveryEnabled()
ConsumerConfigisConsumerRecoveryEnabled in interface ConsumerConfigConsumerConfig.withConsumerRecovery(boolean)public boolean isExchangeRecoveryEnabled()
ChannelConfigChannel.exchangeDelete(String).
Defaults to true when channel recovery is configured.
isExchangeRecoveryEnabled in interface ChannelConfigChannelConfig.withExchangeRecovery(boolean)public boolean isQueueRecoveryEnabled()
ChannelConfigChannel.queueDelete(String).
Defaults to true when channel recovery is configured.
isQueueRecoveryEnabled in interface ChannelConfigChannelConfig.withQueueRecovery(boolean)public Config withChannelListeners(ChannelListener... channelListeners)
ChannelConfigchannelListeners to call on channel related events.withChannelListeners in interface ChannelConfigpublic Config withChannelRecoveryPolicy(RecoveryPolicy channelRecoveryPolicy)
ChannelConfigrecoveryPolicy to use for recovering the channel.withChannelRecoveryPolicy in interface ChannelConfigpublic Config withChannelRetryPolicy(RetryPolicy channelRetryPolicy)
ChannelConfigretryPolicy to use for retrying failed invocations on the channel.withChannelRetryPolicy in interface ChannelConfigpublic Config withConnectionListeners(ConnectionListener... connectionListeners)
ConnectionConfigconnectionListeners to call on connection related events.withConnectionListeners in interface ConnectionConfigpublic Config withConnectionRecoveryPolicy(RecoveryPolicy connectionRecoveryPolicy)
ConnectionConfigwithConnectionRecoveryPolicy in interface ConnectionConfigpublic Config withConnectionRetryPolicy(RetryPolicy connectionRetryPolicy)
ConnectionConfigConnection invocation errors.withConnectionRetryPolicy in interface ConnectionConfigpublic Config withConnectRetryPolicy(RetryPolicy connectRetryPolicy)
connection attempt errors. Overrides the
global retry policy.public Config withConsumerListeners(ConsumerListener... consumerListeners)
ConsumerConfigconsumerListeners to call on consumer related events.withConsumerListeners in interface ConsumerConfigpublic Config withConsumerRecovery(boolean enabled)
ConsumerConfigwithConsumerRecovery in interface ConsumerConfigpublic Config withExchangeRecovery(boolean enabled)
ChannelConfigChannel.exchangeDelete(String).withExchangeRecovery in interface ChannelConfigpublic Config withQueueRecovery(boolean enabled)
ChannelConfigChannel.queueDelete(String).withQueueRecovery in interface ChannelConfigpublic Config withRecoveryPolicy(RecoveryPolicy recoveryPolicy)
withConnectionRecoveryPolicy(RecoveryPolicy) and
withChannelRecoveryPolicy(RecoveryPolicy).public Config withRetryPolicy(RetryPolicy retryPolicy)
connection attempt, Connection invocation, and Channel invocation errors. Can
be overridden with specific policies via withConnectRetryPolicy(RetryPolicy),
withConnectionRetryPolicy(RetryPolicy), and
withChannelRetryPolicy(RetryPolicy).Copyright © 2015. All rights reserved.