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

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.

  • Constructor Details

    • 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 Details

    • getBrokerConnection

      public AMQPBrokerConnection getBrokerConnection()
      Returns the AMQPBrokerConnection that this federation is attached to.
      Returns:
      the AMQPBrokerConnection that this federation is attached to
    • getSessionContext

      public AMQPSessionContext getSessionContext()
      Description copied from class: AMQPFederation
      Returns the session context assigned to this federation instance.
      Specified by:
      getSessionContext in class AMQPFederation
      Returns:
      the session context assigned to this federation instance
    • getConnectionContext

      public AMQPConnectionContext getConnectionContext()
      Description copied from class: AMQPFederation
      Returns the session context assigned to this federation instance.
      Specified by:
      getConnectionContext in class AMQPFederation
      Returns:
      the session context assigned to this federation instance
    • getConfiguration

      public AMQPFederationConfiguration getConfiguration()
      Description copied from class: AMQPFederation
      Returns the federation configuration that is in effect.
      Specified by:
      getConfiguration in class AMQPFederation
      Returns:
      the federation configuration that is in effect
    • getCapabilities

      public AMQPFederationCapabilities getCapabilities()
      Description copied from class: AMQPFederation
      Returns the federation capabilities that is in effect following negotiation.
      Specified by:
      getCapabilities in class AMQPFederation
      Returns:
      the federation capabilities that is in effect following negotiation
    • addRemoteQueueMatchPolicy

      public AMQPFederationSource addRemoteQueueMatchPolicy(FederationReceiveFromQueuePolicy queuePolicy)
      Adds a new FederationReceiveFromQueuePolicy entry 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 configured FederationReceiveFromQueuePolicy instance.
      Returns:
      this AMQPFederationSource instance
    • addRemoteAddressMatchPolicy

      public AMQPFederationSource addRemoteAddressMatchPolicy(FederationReceiveFromAddressPolicy addressPolicy)
      Adds a new FederationReceiveFromAddressPolicy entry 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 configured FederationReceiveFromAddressPolicy instance.
      Returns:
      this AMQPFederationSource instance
    • connectionInterrupted

      public final void connectionInterrupted() throws ActiveMQException
      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.
      Throws:
      ActiveMQException - if an error occurs processing the connection interrupted event
    • connectionRestored

      public final void connectionRestored(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 new Connection that represents the currently active connection.
      session - The new Session that 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: AMQPFederation
      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.
      Specified by:
      signalResourceCreateError in class AMQPFederation
      Parameters:
      cause - The error that caused the resource creation to fail.
    • signalError

      protected void signalError(Exception cause)
      Description copied from class: AMQPFederation
      Error signaling API that must be implemented by the specific federation implementation to handle errors encountered during normal operations.
      Specified by:
      signalError in class AMQPFederation
      Parameters:
      cause - The error that caused the operation to fail.