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 -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final booleanDefault 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
ConstructorsConstructorDescriptionAMQPBrokerConnection(AMQPBrokerConnectionManager connectionManager, AMQPBrokerConnectConfiguration brokerConnectConfiguration, ProtonProtocolManagerFactory protonProtocolManagerFactory, org.apache.activemq.artemis.core.server.ActiveMQServer server) -
Method Summary
Modifier and TypeMethodDescriptionaddLinkClosedInterceptor(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 returnstrueindicate 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) voidvoidprotected voidorg.apache.activemq.artemis.core.remoting.impl.netty.NettyConnectionintgetName()org.apache.activemq.artemis.core.server.ActiveMQServervoidbooleanbooleanstatic booleanisCoreMessageTunnelingEnabled(AMQPMirrorBrokerConnectionElement configuration) booleanRemove a previously registered link close interceptor from the broker connection.voidvoidruntimeError(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.voidshutdown()voidstart()voidstop()voidvalidateMatching(org.apache.activemq.artemis.core.server.Queue queue, AMQPBrokerConnectionElement connectionElement) Methods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.apache.activemq.artemis.core.server.ActiveMQComponent
asyncStopMethods inherited from interface ActiveMQServerBasePlugin
init, registered, setInit, unregisteredMethods inherited from interface ActiveMQServerQueuePlugin
afterDestroyQueue, afterExpiryScan, beforeCreateQueue, beforeCreateQueue, beforeDestroyQueue, beforeDestroyQueue, beforeExpiryScan
-
Field Details
-
DEFAULT_CORE_MESSAGE_TUNNELING_ENABLED
public static final boolean DEFAULT_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.- See Also:
-
-
Constructor Details
-
AMQPBrokerConnection
public AMQPBrokerConnection(AMQPBrokerConnectionManager connectionManager, AMQPBrokerConnectConfiguration brokerConnectConfiguration, ProtonProtocolManagerFactory protonProtocolManagerFactory, org.apache.activemq.artemis.core.server.ActiveMQServer server) throws Exception - Throws:
Exception
-
-
Method Details
-
getName
- Specified by:
getNamein interfaceorg.apache.activemq.artemis.core.server.BrokerConnection
-
getProtocol
- Specified by:
getProtocolin interfaceorg.apache.activemq.artemis.core.server.BrokerConnection
-
getConfiguration
- Specified by:
getConfigurationin interfaceorg.apache.activemq.artemis.core.server.BrokerConnection
-
isConnected
public boolean isConnected()- Specified by:
isConnectedin 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() -
initialize
-
start
-
stop
public void stop()- Specified by:
stopin interfaceorg.apache.activemq.artemis.core.server.ActiveMQComponent
-
shutdown
-
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 returnstrueindicate 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
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
-
runtimeError
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
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
-
disconnect
-
connectionCreated
public void connectionCreated(org.apache.activemq.artemis.core.server.ActiveMQComponent component, Connection connection, ClientProtocolManager protocol) - Specified by:
connectionCreatedin interfaceBaseConnectionLifeCycleListener<ClientProtocolManager>
-
connectionDestroyed
- Specified by:
connectionDestroyedin interfaceBaseConnectionLifeCycleListener<ClientProtocolManager>
-
connectionException
- Specified by:
connectionExceptionin interfaceBaseConnectionLifeCycleListener<ClientProtocolManager>
-
connectionReadyForWrites
- Specified by:
connectionReadyForWritesin interfaceBaseConnectionLifeCycleListener<ClientProtocolManager>
-
isCoreMessageTunnelingEnabled
public static boolean isCoreMessageTunnelingEnabled(AMQPMirrorBrokerConnectionElement configuration)
-