Class AutorecoveringConnection
java.lang.Object
com.rabbitmq.client.impl.recovery.AutorecoveringConnection
- All Implemented Interfaces:
Connection,NetworkConnection,Recoverable,RecoverableConnection,ShutdownNotifier,Closeable,AutoCloseable
public class AutorecoveringConnection
extends Object
implements RecoverableConnection, NetworkConnection
Connection implementation that performs automatic recovery when
connection shutdown is not initiated by the application (e.g. due to
an I/O exception).
Topology (exchanges, queues, bindings, and consumers) can be (and by default is) recovered
as well, in this order:
- Exchanges
- Queues
- Bindings (both queue and exchange-to-exchange)
- Consumers
- Since:
- 3.3.0
- See Also:
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionAutorecoveringConnection(ConnectionParams params, FrameHandlerFactory f, AddressResolver addressResolver) AutorecoveringConnection(ConnectionParams params, FrameHandlerFactory f, AddressResolver addressResolver, MetricsCollector metricsCollector, ObservationCollector observationCollector) AutorecoveringConnection(ConnectionParams params, FrameHandlerFactory f, List<Address> addrs) -
Method Summary
Modifier and TypeMethodDescriptionvoidabort()Abort this connection and all its channels with theAMQP.REPLY_SUCCESSclose code and message 'OK'.voidabort(int timeout) Abort this connection and all its channels with theAMQP.REPLY_SUCCESSclose code and message 'OK'.voidAbort this connection and all its channels.voidAbort this connection and all its channels.addBlockedListener(BlockedCallback blockedCallback, UnblockedCallback unblockedCallback) Add a lambda-basedBlockedListener.voidaddBlockedListener(BlockedListener listener) Add aBlockedListener.voidNot part of the public API.voidNot part of the public API.voidaddRecoveryListener(RecoveryListener listener) Adds the recovery listenervoidaddShutdownListener(ShutdownListener listener) Add shutdown listener.voidRemove allBlockedListeners.voidclose()Close this connection and all its channels with theAMQP.REPLY_SUCCESSclose code and message 'OK'.voidclose(int timeout) Close this connection and all its channels with theAMQP.REPLY_SUCCESSclose code and message 'OK'.voidClose this connection and all its channels.voidClose this connection and all its channels.Create a new channel, using an internally allocated channel number.createChannel(int channelNumber) Create a new channel, using the specified channel number if possible.voidexcludeQueueFromRecovery(String queue, boolean ifUnused) Exclude the queue from the list of queues to recover after connection failure.Retrieve the host.intGet the negotiated maximum channel number.Get a copy of the map of client properties sent to the serverReturns client-provided connection name, if any.Get the shutdown reason objectNot supposed to be used outside of automated tests.Get the exception handler.intGet the negotiated maximum frame size.intGet the negotiated heartbeat interval.getId()Public API - Returns a unique ID for this connection.Retrieve the local host.intRetrieve the local port number.intgetPort()Retrieve the port number.