Class AMQPBrokerConnection

java.lang.Object
org.apache.activemq.artemis.protocol.amqp.connect.AMQPBrokerConnection
All Implemented Interfaces:
org.apache.activemq.artemis.core.server.ActiveMQComponent, org.apache.activemq.artemis.core.server.BrokerConnection, ActiveMQServerBasePlugin, ActiveMQServerQueuePlugin, BaseConnectionLifeCycleListener<ClientProtocolManager>, ClientConnectionLifeCycleListener

public class AMQPBrokerConnection extends Object implements ClientConnectionLifeCycleListener, ActiveMQServerQueuePlugin, org.apache.activemq.artemis.core.server.BrokerConnection
  • Field Details

    • DEFAULT_CORE_MESSAGE_TUNNELING_ENABLED

      public static final boolean DEFAULT_CORE_MESSAGE_TUNNELING_ENABLED
      Default value for the core message tunneling feature that indicates if core protocol messages should be streamed as binary blobs as the payload of an custom AMQP message which avoids any conversions of the messages to / from AMQP.
      See Also:
  • Constructor Details

  • Method Details

    • getName

      public String getName()
      Specified by:
      getName in interface org.apache.activemq.artemis.core.server.BrokerConnection
    • getProtocol

      public String getProtocol()
      Specified by:
      getProtocol in interface org.apache.activemq.artemis.core.server.BrokerConnection
    • getConfiguration

      public AMQPBrokerConnectConfiguration getConfiguration()
      Specified by:
      getConfiguration in interface org.apache.activemq.artemis.core.server.BrokerConnection
    • isConnected

      public boolean isConnected()
      Specified by:
      isConnected in interface org.apache.activemq.artemis.core.server.BrokerConnection
    • isStarted

      public boolean isStarted()
      Specified by:
      isStarted in interface org.apache.activemq.artemis.core.server.ActiveMQComponent
    • isConnecting

      public boolean isConnecting()
    • getConnectionTimeout

      public int getConnectionTimeout()
    • initialize

      public void initialize() throws Exception
      Specified by:
      initialize in interface org.apache.activemq.artemis.core.server.BrokerConnection
      Throws:
      Exception
    • start

      public void start() throws Exception
      Specified by:
      start in interface org.apache.activemq.artemis.core.server.ActiveMQComponent
      Throws:
      Exception
    • stop

      public void stop()
      Specified by:
      stop in interface org.apache.activemq.artemis.core.server.ActiveMQComponent
    • shutdown

      public void shutdown() throws Exception
      Specified by:
      shutdown in interface org.apache.activemq.artemis.core.server.BrokerConnection
      Throws:
      Exception
    • getServer

      public org.apache.activemq.artemis.core.server.ActiveMQServer getServer()
    • getConnection

      public org.apache.activemq.artemis.core.remoting.impl.netty.NettyConnection getConnection()
    • afterCreateQueue

      public void afterCreateQueue(org.apache.activemq.artemis.core.server.Queue queue)
      Specified by:
      afterCreateQueue in interface ActiveMQServerQueuePlugin
    • validateMatching

      public void validateMatching(org.apache.activemq.artemis.core.server.Queue queue, AMQPBrokerConnectionElement connectionElement)
    • createLink

      public void createLink(org.apache.activemq.artemis.core.server.Queue queue, AMQPBrokerConnectionElement connectionElement)
    • addLinkClosedInterceptor

      public AMQPBrokerConnection addLinkClosedInterceptor(String id, Predicate<org.apache.qpid.proton.engine.Link> interceptor)
      Adds a remote link closed event interceptor that can intercept the closed event and if it returns true indicate that the close has been handled and that normal broker connection remote link closed handling should be ignored.
      Parameters:
      id - A unique Id value that identifies the intercepter for later removal.
      interceptor - The predicate that will be called for any link close.
      Returns:
      this broker connection instance
    • removeLinkClosedInterceptor

      public AMQPBrokerConnection removeLinkClosedInterceptor(String id)
      Remove a previously registered link close interceptor from the broker connection.
      Parameters:
      id - The id of the interceptor to remove
      Returns:
      this broker connection instance
    • retryConnection

      public void retryConnection()
    • error

      public void error(Throwable e)
    • runtimeError

      public void runtimeError(Throwable error)
      Provides an error API for resources of the broker connection that encounter errors during the normal operation of the resource that represent a terminal outcome for the connection. The connection retry counter will be reset to zero for these types of errors as these indicate a connection interruption that should initiate the start of a reconnect cycle if reconnection is configured.
      Parameters:
      error - The exception that describes the terminal connection error.
    • connectError

      public void connectError(Throwable error)
      Provides an error API for resources of the broker connection that encounter errors during the connection / resource initialization phase that should constitute a terminal outcome for the connection. The connection retry counter will be incremented for these types of errors which can result in eventual termination of reconnect attempts when the limit is exceeded.
      Parameters:
      error - The exception that describes the terminal connection error.
    • error

      protected void error(Throwable e, int retryCounter)
    • disconnect

      public void disconnect() throws Exception
      Throws:
      Exception
    • connectionCreated

      public void connectionCreated(org.apache.activemq.artemis.core.server.ActiveMQComponent component, Connection connection, ClientProtocolManager protocol)
      Specified by:
      connectionCreated in interface BaseConnectionLifeCycleListener<ClientProtocolManager>
    • connectionDestroyed

      public void connectionDestroyed(Object connectionID, boolean failed)
      Specified by:
      connectionDestroyed in interface BaseConnectionLifeCycleListener<ClientProtocolManager>
    • connectionException

      public void connectionException(Object connectionID, ActiveMQException me)
      Specified by:
      connectionException in interface BaseConnectionLifeCycleListener<ClientProtocolManager>
    • connectionReadyForWrites

      public void connectionReadyForWrites(Object connectionID, boolean ready)
      Specified by:
      connectionReadyForWrites in interface BaseConnectionLifeCycleListener<ClientProtocolManager>
    • isCoreMessageTunnelingEnabled

      public static boolean isCoreMessageTunnelingEnabled(AMQPMirrorBrokerConnectionElement configuration)