Class AMQPFederationQueuePolicyManager
java.lang.Object
org.apache.activemq.artemis.protocol.amqp.connect.federation.AMQPFederationPolicyManager
org.apache.activemq.artemis.protocol.amqp.connect.federation.AMQPFederationLocalPolicyManager
org.apache.activemq.artemis.protocol.amqp.connect.federation.AMQPFederationQueuePolicyManager
- All Implemented Interfaces:
ActiveMQServerBasePlugin, ActiveMQServerBindingPlugin, ActiveMQServerConsumerPlugin
public final class AMQPFederationQueuePolicyManager
extends AMQPFederationLocalPolicyManager
implements ActiveMQServerConsumerPlugin, ActiveMQServerBindingPlugin
The AMQP Federation implementation of an federation queue policy manager.
-
Nested Class Summary
Nested classes/interfaces inherited from class AMQPFederationPolicyManager
AMQPFederationPolicyManager.State -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final Map<FederationConsumerInfo, org.apache.activemq.artemis.protocol.amqp.connect.federation.AMQPFederationQueuePolicyManager.AMQPFederationQueueConsumerManager> protected final FederationReceiveFromQueuePolicyFields inherited from class AMQPFederationLocalPolicyManager
configurationFields inherited from class AMQPFederationPolicyManager
connected, federation, metrics, policyName, policyType, server, session, state -
Constructor Summary
ConstructorsConstructorDescriptionAMQPFederationQueuePolicyManager(AMQPFederation federation, AMQPFederationMetrics metrics, FederationReceiveFromQueuePolicy queuePolicy) -
Method Summary
Modifier and TypeMethodDescriptionvoidafterCloseConsumer(org.apache.activemq.artemis.core.server.ServerConsumer consumer, boolean failed) voidafterCreateConsumer(org.apache.activemq.artemis.core.server.ServerConsumer consumer) voidafterRemoteQueueAdded(String addressName, String queueName) Checks if the remote queue added falls within the set of queues that match the configured queue policy and if so scans for local demand on that queue to see if a new attempt to federate the queue is needed.voidafterRemoveBinding(org.apache.activemq.artemis.core.postoffice.Binding binding, org.apache.activemq.artemis.core.transaction.Transaction tx, boolean deleteData) Returns the receive from address policy that backs the address policy manager.protected voidsafeCleanupManagerResources(boolean force) The subclass implements this method and should remove all tracked federation consumer data and also close all consumers either by first safely stopping the consumer or if offline simply closing the consumer.protected voidScans all bindings and push them through the normal bindings checks that would be done on an add.protected voidupdateStateAfterConnect(AMQPFederationConsumerConfiguration configuration, AMQPSessionContext session) Allows the policy manager implementation to update internal state after (re)connection and before the policy manager triggers a scan of all bindings to check for existing or new demand.Methods inherited from class AMQPFederationLocalPolicyManager
getConfiguration, handleConnectionInterrupted, handleConnectionRestored, handleManagerInitialized, handleManagerShutdown, handleManagerStarted, handleManagerStopped, isPluginBlockingFederationConsumerCreate, isPluginBlockingFederationConsumerCreate, isPluginBlockingFederationConsumerCreate, signalPluginAfterCloseFederationConsumer, signalPluginAfterCreateFederationConsumer, signalPluginBeforeCloseFederationConsumer, signalPluginBeforeCreateFederationConsumer, tryCloseFederationConsumerMethods inherited from class AMQPFederationPolicyManager
connectionInterrupted, connectionRestored, failIfShutdown, getFederation, getMetrics, getPolicyName, getPolicyType, initialize, isActive, isConnected, isStarted, shutdown, start, stopMethods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface ActiveMQServerBasePlugin
init, registered, setInit, unregisteredMethods inherited from interface ActiveMQServerBindingPlugin
afterAddBinding, beforeAddBinding, beforeRemoveBindingMethods inherited from interface ActiveMQServerConsumerPlugin
beforeCloseConsumer, beforeCreateConsumer, beforeCreateConsumer
-
Field Details
-
policy
-
federationConsumers
protected final Map<FederationConsumerInfo, org.apache.activemq.artemis.protocol.amqp.connect.federation.AMQPFederationQueuePolicyManager.AMQPFederationQueueConsumerManager> federationConsumers
-
-
Constructor Details
-
AMQPFederationQueuePolicyManager
public AMQPFederationQueuePolicyManager(AMQPFederation federation, AMQPFederationMetrics metrics, FederationReceiveFromQueuePolicy queuePolicy) throws ActiveMQException - Throws:
ActiveMQException
-
-
Method Details
-
getPolicy
Returns the receive from address policy that backs the address policy manager.- Specified by:
getPolicyin classAMQPFederationLocalPolicyManager- Returns:
- the receive from address policy that backs the address policy manager
-
safeCleanupManagerResources
protected void safeCleanupManagerResources(boolean force) Description copied from class:AMQPFederationLocalPolicyManagerThe subclass implements this method and should remove all tracked federation consumer data and also close all consumers either by first safely stopping the consumer or if offline simply closing the consumer. If the force flag is set to true the implementation should close the consumer without attempting to stop it by draining link credit before the close.- Specified by:
safeCleanupManagerResourcesin classAMQPFederationLocalPolicyManager- Parameters:
force- Should the implementation simply close the consumers without attempting a stop.
-
afterCreateConsumer
public void afterCreateConsumer(org.apache.activemq.artemis.core.server.ServerConsumer consumer) - Specified by:
afterCreateConsumerin interfaceActiveMQServerConsumerPlugin
-
afterCloseConsumer
public void afterCloseConsumer(org.apache.activemq.artemis.core.server.ServerConsumer consumer, boolean failed) - Specified by:
afterCloseConsumerin interfaceActiveMQServerConsumerPlugin
-
afterRemoveBinding
public void afterRemoveBinding(org.apache.activemq.artemis.core.postoffice.Binding binding, org.apache.activemq.artemis.core.transaction.Transaction tx, boolean deleteData) throws ActiveMQException - Specified by:
afterRemoveBindingin interfaceActiveMQServerBindingPlugin- Throws:
ActiveMQException
-
scanAllBindings
protected void scanAllBindings()Description copied from class:AMQPFederationLocalPolicyManagerScans all bindings and push them through the normal bindings checks that would be done on an add. This allows for checks on demand after a start or after a connection is restored.- Specified by:
scanAllBindingsin classAMQPFederationLocalPolicyManager
-
updateStateAfterConnect
protected void updateStateAfterConnect(AMQPFederationConsumerConfiguration configuration, AMQPSessionContext session) Description copied from class:AMQPFederationLocalPolicyManagerAllows the policy manager implementation to update internal state after (re)connection and before the policy manager triggers a scan of all bindings to check for existing or new demand.- Specified by:
updateStateAfterConnectin classAMQPFederationLocalPolicyManager- Parameters:
configuration- The updated configuration based on the current connection.session- The session that matches the current connection.
-
afterRemoteQueueAdded
Checks if the remote queue added falls within the set of queues that match the configured queue policy and if so scans for local demand on that queue to see if a new attempt to federate the queue is needed.- Parameters:
addressName- The address that was added on the remote.queueName- The queue that was added on the remote.- Throws:
Exception- if an error occurs while processing the queue added event.
-