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.
|
RetryPolicy |
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.
|
RetryPolicy |
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.
|
boolean |
isConsumerRecoveryEnabled()
Returns whether consumer 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(RetryPolicy 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(RetryPolicy 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 |
withRecoveryPolicy(RetryPolicy 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 Collection<ChannelListener> getChannelListeners()
ChannelConfiggetChannelListeners in interface ChannelConfigChannelConfig.withChannelListeners(ChannelListener...)public RetryPolicy getChannelRecoveryPolicy()
ChannelConfiggetChannelRecoveryPolicy in interface ChannelConfigChannelConfig.withChannelRecoveryPolicy(RetryPolicy)public RetryPolicy getChannelRetryPolicy()
ChannelConfiggetChannelRetryPolicy in interface ChannelConfigChannelConfig.withChannelRetryPolicy(RetryPolicy)public Collection<ConnectionListener> getConnectionListeners()
ConnectionConfiggetConnectionListeners in interface ConnectionConfigConnectionConfig.withConnectionListeners(ConnectionListener...)public RetryPolicy getConnectionRecoveryPolicy()
ConnectionConfiggetConnectionRecoveryPolicy in interface ConnectionConfigConnectionConfig.withConnectionRecoveryPolicy(RetryPolicy)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 boolean isConsumerRecoveryEnabled()
ConsumerConfigisConsumerRecoveryEnabled in interface ConsumerConfigConsumerConfig.withConsumerRecovery(boolean)public Config withChannelListeners(ChannelListener... channelListeners)
ChannelConfigchannelListeners to call on channel related events.withChannelListeners in interface ChannelConfigpublic Config withChannelRecoveryPolicy(RetryPolicy 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(RetryPolicy 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 withRecoveryPolicy(RetryPolicy recoveryPolicy)
withConnectionRecoveryPolicy(RetryPolicy) and
withChannelRecoveryPolicy(RetryPolicy).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).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 LyraCopyright © 2013. All rights reserved.