Class DefaultSenderController

java.lang.Object
org.apache.activemq.artemis.protocol.amqp.proton.DefaultSenderController
All Implemented Interfaces:
SenderController

public class DefaultSenderController extends Object implements SenderController
The default SenderController instance used by and sender context that is not assigned a custom controller. This controller is extensible so that specialized sender controllers can be created from it.

The default controller works best with incoming AMQP clients and JMS over AMQP clients. For intra-broker connections it is likely that a custom sender controller would be a more appropriate option than using the default controller.

  • Constructor Details

    • DefaultSenderController

      public DefaultSenderController(AMQPSessionContext session, org.apache.qpid.proton.engine.Sender protonSender, String clientId)
  • Method Details

    • init

      public org.apache.activemq.artemis.core.server.Consumer init(ProtonServerSenderContext senderContext) throws Exception
      Description copied from interface: SenderController
      Initialize sender controller state and handle open of AMQP sender resources
      Specified by:
      init in interface SenderController
      Parameters:
      senderContext - The sender context that is requesting controller initialization.
      Returns:
      a server consumer that has been initialize by the controller
      Throws:
      Exception - if an error occurs during initialization.
    • close

      public void close(boolean remoteClose) throws Exception
      Description copied from interface: SenderController
      Handle close of the sever sender AMQP resources either from remote link detach or local close usually due to connection drop.
      Specified by:
      close in interface SenderController
      Parameters:
      remoteClose - Indicates if the remote link detached the sender or local action closed it.
      Throws:
      Exception - if an error occurs during close.
    • selectOutgoingMessageWriter

      public MessageWriter selectOutgoingMessageWriter(ProtonServerSenderContext sender, org.apache.activemq.artemis.core.server.MessageReference reference)
      Description copied from interface: SenderController
      Controller selects a outgoing delivery writer that will handle the encoding and writing of the target Message carried in the given MessageReference. The selection process should take into account how the message pre-processing will mutate the outgoing message.

      The default implementation performs no caching of writers and should be overridden in subclasses to reduce GC churn, the default version is suitable for tests.

      Specified by:
      selectOutgoingMessageWriter in interface SenderController
      Parameters:
      sender - The server sender that will make use of the returned delivery context.
      reference - The message that must be sent using an outgoing context
      Returns:
      an MessageWriter to use when sending the message in the reference
    • getMatchingQueue

      protected SimpleString getMatchingQueue(SimpleString queueName, SimpleString address, RoutingType routingType, SimpleString filter, boolean matchFilter) throws Exception
      Throws:
      Exception