Class AMQPFederationSource
- java.lang.Object
-
- org.apache.activemq.artemis.protocol.amqp.connect.federation.AMQPFederation
-
- org.apache.activemq.artemis.protocol.amqp.connect.federation.AMQPFederationSource
-
- All Implemented Interfaces:
Federation,FederationInternal
public class AMQPFederationSource extends AMQPFederation
This is the initiating side of a broker federation that occurs over an AMQP broker connection.This endpoint will create a control link to the remote peer that is a sender of federation commands which can be used to instruct the remote to initiate federation operations back to this peer over the same connection and without the need for local configuration.
-
-
Field Summary
-
Fields inherited from class org.apache.activemq.artemis.protocol.amqp.connect.federation.AMQPFederation
addressMatchPolicies, connected, connection, eventDispatcher, eventProcessor, FEDERATION_INSTANCE_RECORD, linkClosedinterceptors, name, queueMatchPolicies, scheduler, server, session, started, wildcardConfiguration
-
-
Constructor Summary
Constructors Constructor Description AMQPFederationSource(String name, Map<String,Object> properties, AMQPBrokerConnection connection)Creates a new AMQP Federation instance that will manage the state of a single AMQP broker federation instance using an AMQP broker connection as the IO channel.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description AMQPFederationSourceaddRemoteAddressMatchPolicy(FederationReceiveFromAddressPolicy addressPolicy)Adds a newFederationReceiveFromAddressPolicyentry to the set of policies that the remote end of this federation will use to create demand on the this server when local demand is present.AMQPFederationSourceaddRemoteQueueMatchPolicy(FederationReceiveFromQueuePolicy queuePolicy)Adds a newFederationReceiveFromQueuePolicyentry to the set of policies that the remote end of this federation will use to create demand on the this server when local demand is present.AMQPBrokerConnectiongetBrokerConnection()AMQPConnectionContextgetConnectionContext()intgetLargeMessageThreshold()intgetLinkAttachTimeout()intgetReceiverCredits()intgetReceiverCreditsLow()AMQPSessionContextgetSessionContext()voidhandleConnectionDropped()Called by the parent broker connection when the connection has failed and this federation should tear down any active resources and await a reconnect if one is allowed.voidhandleConnectionRestored(AMQPConnectionContext connection, AMQPSessionContext session)Called by the parent broker connection when the connection has been established and this federation should build up its active state based on the configuration.protected booleaninterceptLinkClosedEvent(org.apache.qpid.proton.engine.Link link)booleanisCoreMessageTunnelingEnabled()booleanisIgnoreQueueConsumerFilters()booleanisIgnoreQueueConsumerPriorities()protected voidsignalError(Exception cause)Error signaling API that must be implemented by the specific federation implementation to handle errors encountered during normal operations.protected voidsignalResourceCreateError(Exception cause)Error signaling API that must be implemented by the specific federation implementation to handle error when creating a federation resource such as an outgoing receiver link.-
Methods inherited from class org.apache.activemq.artemis.protocol.amqp.connect.federation.AMQPFederation
addAddressMatchPolicy, addLinkClosedInterceptor, addQueueMatchPolicy, getName, getScheduler, getServer, getWildcardConfiguration, handleFederationStarted, handleFederationStopped, invokeLinkClosedInterceptors, isStarted, removeLinkClosedInterceptor, signalFederationStarted, signalFederationStopped, start, stop
-
-
-
-
Constructor Detail
-
AMQPFederationSource
public AMQPFederationSource(String name, Map<String,Object> properties, AMQPBrokerConnection connection)
Creates a new AMQP Federation instance that will manage the state of a single AMQP broker federation instance using an AMQP broker connection as the IO channel.- Parameters:
name- The name of this federation instance.properties- A set of optional properties that provide additional configuration.connection- The broker connection over which this federation will occur.
-
-
Method Detail
-
getBrokerConnection
public AMQPBrokerConnection getBrokerConnection()
- Returns:
- the
AMQPBrokerConnectionthat this federation is attached to.
-
getLinkAttachTimeout
public int getLinkAttachTimeout()
- Specified by:
getLinkAttachTimeoutin classAMQPFederation- Returns:
- the timeout before signaling an error when creating remote link (0 mean disable).
-
getSessionContext
public AMQPSessionContext getSessionContext()
- Specified by:
getSessionContextin classAMQPFederation- Returns:
- the session context assigned to this federation instance
-
getConnectionContext
public AMQPConnectionContext getConnectionContext()
- Specified by:
getConnectionContextin classAMQPFederation- Returns:
- the session context assigned to this federation instance
-
getReceiverCredits
public int getReceiverCredits()
- Specified by:
getReceiverCreditsin classAMQPFederation- Returns:
- the configured
Receiverlink credit batch size.
-
getReceiverCreditsLow
public int getReceiverCreditsLow()
- Specified by:
getReceiverCreditsLowin classAMQPFederation- Returns:
- the configured
Receiverlink credit low value.
-
getLargeMessageThreshold
public int getLargeMessageThreshold()
- Specified by:
getLargeMessageThresholdin classAMQPFederation- Returns:
- the size in bytes before a message is considered large.
-
isCoreMessageTunnelingEnabled
public boolean isCoreMessageTunnelingEnabled()
- Specified by:
isCoreMessageTunnelingEnabledin classAMQPFederation- Returns:
- the true if the federation should support core message tunneling.
-
isIgnoreQueueConsumerFilters
public boolean isIgnoreQueueConsumerFilters()
- Specified by:
isIgnoreQueueConsumerFiltersin classAMQPFederation- Returns:
- the true if the federation should ignore filters on queue consumers.
-
isIgnoreQueueConsumerPriorities
public boolean isIgnoreQueueConsumerPriorities()
- Specified by:
isIgnoreQueueConsumerPrioritiesin classAMQPFederation- Returns:
- the true if the federation should ignore priorities on queue consumers.
-
addRemoteQueueMatchPolicy
public AMQPFederationSource addRemoteQueueMatchPolicy(FederationReceiveFromQueuePolicy queuePolicy)
Adds a newFederationReceiveFromQueuePolicyentry to the set of policies that the remote end of this federation will use to create demand on the this server when local demand is present.- Parameters:
queuePolicy- The policy to add to the set of configuredFederationReceiveFromQueuePolicyinstance.- Returns:
- this
AMQPFederationSourceinstance.
-
addRemoteAddressMatchPolicy
public AMQPFederationSource addRemoteAddressMatchPolicy(FederationReceiveFromAddressPolicy addressPolicy)
Adds a newFederationReceiveFromAddressPolicyentry to the set of policies that the remote end of this federation will use to create demand on the this server when local demand is present.- Parameters:
addressPolicy- The policy to add to the set of configuredFederationReceiveFromAddressPolicyinstance.- Returns:
- this
AMQPFederationSourceinstance.
-
handleConnectionDropped
public void handleConnectionDropped() throws ActiveMQExceptionCalled by the parent broker connection when the connection has failed and this federation should tear down any active resources and await a reconnect if one is allowed.- Throws:
ActiveMQException- if an error occurs processing the connection dropped event
-
handleConnectionRestored
public void handleConnectionRestored(AMQPConnectionContext connection, AMQPSessionContext session) throws ActiveMQException
Called by the parent broker connection when the connection has been established and this federation should build up its active state based on the configuration.- Parameters:
connection- The newConnectionthat represents the currently active connection.session- The newSessionthat was created for use by broker connection resources.- Throws:
ActiveMQException- if an error occurs processing the connection restored event
-
signalResourceCreateError
protected void signalResourceCreateError(Exception cause)
Description copied from class:AMQPFederationError signaling API that must be implemented by the specific federation implementation to handle error when creating a federation resource such as an outgoing receiver link.- Specified by:
signalResourceCreateErrorin classAMQPFederation- Parameters:
cause- The error that caused the resource creation to fail.
-
signalError
protected void signalError(Exception cause)
Description copied from class:AMQPFederationError signaling API that must be implemented by the specific federation implementation to handle errors encountered during normal operations.- Specified by:
signalErrorin classAMQPFederation- Parameters:
cause- The error that caused the operation to fail.
-
interceptLinkClosedEvent
protected boolean interceptLinkClosedEvent(org.apache.qpid.proton.engine.Link link)
-
-