Class AMQPFederationAddressBindingsConsumer
java.lang.Object
org.apache.activemq.artemis.protocol.amqp.connect.federation.AMQPFederationConsumer
org.apache.activemq.artemis.protocol.amqp.connect.federation.AMQPFederationAddressConsumer
org.apache.activemq.artemis.protocol.amqp.connect.federation.AMQPFederationAddressBindingsConsumer
- All Implemented Interfaces:
FederationConsumer
Consumer implementation for Federated Addresses that receives from a remote AMQP peer and forwards those messages
onto the internal bindings on a given address that matched criteria of the given
FederationConsumerInfo.
The consumer is subscribed to the remote address likely using a filter that matches the filter of one or more
local bindings on an address which defines the local demand. Once a message is sent from the remote this consumer
routes that message to each of the local consumers that triggered the federation link.
The goal of this federation consumer implementation is to allow consumption of a more limited set of messages from a remote address by applying filters for local address consumers and routing the resulting messages directly to them. The possible down side here is that if the filters being used aren't fine grained enough that consumers with differing filters might still have overlaps in the messages they receive which would then produce more message traffic across the federation than would be generated if using the standard conduit consumer pattern (this can also happen if filtered and non-filtered consumers are mixed on the local address).
-
Nested Class Summary
Nested classes/interfaces inherited from class AMQPFederationAddressConsumer
AMQPFederationAddressConsumer.AMQPFederatedAddressDeliveryHandler -
Field Summary
Fields inherited from class AMQPFederationConsumer
closed, configuration, connection, consumerInfo, DEFAULT_OUTCOME, federation, initialized, LINK_SEQUENCE_ID, manager, metrics, OUTCOMES, protonReceiver, receiver, remoteCloseHandler, remoteCloseInterceptor, remoteOpenHandler, session, transformer -
Constructor Summary
ConstructorsConstructorDescriptionAMQPFederationAddressBindingsConsumer(AMQPFederationAddressPolicyManager manager, AMQPFederationConsumerConfiguration configuration, AMQPSessionContext session, FederationConsumerInfo consumerInfo, AMQPFederationMetrics.ConsumerMetrics metrics) -
Method Summary
Modifier and TypeMethodDescriptionvoidaddBinding(org.apache.activemq.artemis.core.postoffice.Binding binding) Adds aBindingto the set of bindings that should receive messages from the remote to the collection of tracked bindings.voidaddBindings(Collection<org.apache.activemq.artemis.core.postoffice.Binding> currentBindings) Adds a collection ofBindinginstances that should have any received messages routed to them as they arrive from the remote.createDeliveryHandler(org.apache.qpid.proton.engine.Receiver receiver) Create the delivery handler instance that will assigned as the context on the AMQP receiver link instance.voidremoveBinding(org.apache.activemq.artemis.core.postoffice.Binding binding) Removes aBindingfrom the set of bindings that should receive messages from the remote to the collection of tracked bindings.Methods inherited from class AMQPFederationAddressConsumer
doCreateReceiver, getReceiverIdleTimeoutMethods inherited from class AMQPFederationConsumer
close, getConfiguration, getConsumerInfo, getFederation, getMessagesReceived, getPolicyManager, getRole, initialize, isClosed, isInitialized, recordFederatedMessageReceived, remoteLinkClosedInterceptor, setRemoteClosedHandler, setRemoteOpenHandler, signalPluginAfterFederationConsumerMessageHandled, signalPluginBeforeFederationConsumerMessageHandled, startAsync, stopAsync
-
Constructor Details
-
AMQPFederationAddressBindingsConsumer
public AMQPFederationAddressBindingsConsumer(AMQPFederationAddressPolicyManager manager, AMQPFederationConsumerConfiguration configuration, AMQPSessionContext session, FederationConsumerInfo consumerInfo, AMQPFederationMetrics.ConsumerMetrics metrics)
-
-
Method Details
-
createDeliveryHandler
protected AMQPFederationAddressConsumer.AMQPFederatedAddressDeliveryHandler createDeliveryHandler(org.apache.qpid.proton.engine.Receiver receiver) Description copied from class:AMQPFederationAddressConsumerCreate the delivery handler instance that will assigned as the context on the AMQP receiver link instance.- Specified by:
createDeliveryHandlerin classAMQPFederationAddressConsumer- Parameters:
receiver- TheReceiverinstance that the returned delivery handler is bound to.- Returns:
- a new delivery handler that will route incoming messages to their intended target.
-
addBindings
public void addBindings(Collection<org.apache.activemq.artemis.core.postoffice.Binding> currentBindings) Adds a collection ofBindinginstances that should have any received messages routed to them as they arrive from the remote.- Parameters:
currentBindings- The bindings that should receive any messages sent from the remote
-
addBinding
public void addBinding(org.apache.activemq.artemis.core.postoffice.Binding binding) Adds aBindingto the set of bindings that should receive messages from the remote to the collection of tracked bindings.- Parameters:
binding- TheBindingto add to the tracked collection.
-
removeBinding
public void removeBinding(org.apache.activemq.artemis.core.postoffice.Binding binding) Removes aBindingfrom the set of bindings that should receive messages from the remote to the collection of tracked bindings.- Parameters:
binding- TheBindingto remove from the tracked collection.
-