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
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classAMQPBrokerConnection.NettyConnectorCloseHandler
-
Field Summary
Fields Modifier and Type Field Description static booleanDEFAULT_CORE_MESSAGE_TUNNELING_ENABLEDDefault 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.
-
Constructor Summary
Constructors Constructor Description AMQPBrokerConnection(AMQPBrokerConnectionManager bridgeManager, AMQPBrokerConnectConfiguration brokerConnectConfiguration, ProtonProtocolManagerFactory protonProtocolManagerFactory, org.apache.activemq.artemis.core.server.ActiveMQServer server)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description AMQPBrokerConnectionaddLinkClosedInterceptor(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.voidafterCreateQueue(org.apache.activemq.artemis.core.server.Queue queue)voidconnectError(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.voidconnectionCreated(org.apache.activemq.artemis.core.server.ActiveMQComponent component, Connection connection, ClientProtocolManager protocol)voidconnectionDestroyed(Object connectionID, boolean failed)voidconnectionException(Object connectionID, ActiveMQException me)voidconnectionReadyForWrites(Object connectionID, boolean ready)voidcreateLink(org.apache.activemq.artemis.core.server.Queue queue, AMQPBrokerConnectionElement connectionElement)voiddisconnect()voiderror(Throwable e)protected voiderror(Throwable e, int retryCounter)AMQPBrokerConnectConfigurationgetConfiguration()org.apache.activemq.artemis.core.remoting.impl.netty.NettyConnectiongetConnection()intgetConnectionTimeout()StringgetName()StringgetProtocol()org.apache.activemq.artemis.core.server.ActiveMQServergetServer()booleanisConnecting()static booleanisCoreMessageTunnelingEnabled(AMQPMirrorBrokerConnectionElement configuration)booleanisStarted()AMQPBrokerConnectionremoveLinkClosedInterceptor(String id)Remove a previously registered link close interceptor from the broker connection.voidretryConnection()voidruntimeError(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.voidstart()voidstop()voidvalidateMatching(org.apache.activemq.artemis.core.server.Queue queue, AMQPBrokerConnectionElement connectionElement)-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.apache.activemq.artemis.core.server.ActiveMQComponent
asyncStop
-
Methods inherited from interface org.apache.activemq.artemis.core.server.plugin.ActiveMQServerBasePlugin
init, registered, setInit, unregistered
-
Methods inherited from interface org.apache.activemq.artemis.core.server.plugin.ActiveMQServerQueuePlugin
afterDestroyQueue, afterExpiryScan, beforeCreateQueue, beforeCreateQueue, beforeDestroyQueue, beforeDestroyQueue, beforeExpiryScan
-
-
-
-
Field Detail
-
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:
- Constant Field Values
-
-
Constructor Detail
-
AMQPBrokerConnection
public AMQPBrokerConnection(AMQPBrokerConnectionManager bridgeManager, AMQPBrokerConnectConfiguration brokerConnectConfiguration, ProtonProtocolManagerFactory protonProtocolManagerFactory, org.apache.activemq.artemis.core.server.ActiveMQServer server) throws Exception
- Throws:
Exception
-
-
Method Detail
-
getName
public String getName()
- Specified by:
getNamein interfaceorg.apache.activemq.artemis.core.server.BrokerConnection
-
getProtocol
public String getProtocol()
- Specified by:
getProtocolin interfaceorg.apache.activemq.artemis.core.server.BrokerConnection
-
getConfiguration
public AMQPBrokerConnectConfiguration getConfiguration()
- Specified by:
getConfigurationin interfaceorg.apache.activemq.artemis.core.server.BrokerConnection
-
isStarted
public boolean isStarted()
- Specified by:
isStartedin interfaceorg.apache.activemq.artemis.core.server.ActiveMQComponent
-
isConnecting
public boolean isConnecting()
-
getConnectionTimeout
public int getConnectionTimeout()
-
stop
public void stop()
- Specified by:
stopin interfaceorg.apache.activemq.artemis.core.server.ActiveMQComponent
-
start
public void start() throws Exception- Specified by:
startin interfaceorg.apache.activemq.artemis.core.server.ActiveMQComponent- 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:
afterCreateQueuein interfaceActiveMQServerQueuePlugin
-
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)
-
connectionCreated
public void connectionCreated(org.apache.activemq.artemis.core.server.ActiveMQComponent component, Connection connection, ClientProtocolManager protocol)- Specified by:
connectionCreatedin interfaceBaseConnectionLifeCycleListener<ClientProtocolManager>
-
connectionDestroyed
public void connectionDestroyed(Object connectionID, boolean failed)
- Specified by:
connectionDestroyedin interfaceBaseConnectionLifeCycleListener<ClientProtocolManager>
-
connectionException
public void connectionException(Object connectionID, ActiveMQException me)
- Specified by:
connectionExceptionin interfaceBaseConnectionLifeCycleListener<ClientProtocolManager>
-
connectionReadyForWrites
public void connectionReadyForWrites(Object connectionID, boolean ready)
- Specified by:
connectionReadyForWritesin interfaceBaseConnectionLifeCycleListener<ClientProtocolManager>
-
isCoreMessageTunnelingEnabled
public static boolean isCoreMessageTunnelingEnabled(AMQPMirrorBrokerConnectionElement configuration)
-
-