java.lang.Object
org.apache.activemq.transport.amqp.protocol.AmqpAbstractLink<org.apache.qpid.proton.engine.Sender>
org.apache.activemq.transport.amqp.protocol.AmqpSender
All Implemented Interfaces:
AmqpLink, AmqpResource

public class AmqpSender extends AmqpAbstractLink<org.apache.qpid.proton.engine.Sender>
An AmqpSender wraps the AMQP Sender end of a link from the remote peer which holds the corresponding Receiver which receives messages transfered across the link from the Broker. An AmqpSender is in turn a message consumer subscribed to some destination on the broker. As messages are dispatched to this sender that are sent on to the remote Receiver end of the lin.
  • Field Summary

    closeActions, closed, endpoint, opened, session
  • Constructor Summary

    Constructors
    Constructor
    Description
    AmqpSender(AmqpSession session, org.apache.qpid.proton.engine.Sender endpoint, org.apache.activemq.command.ConsumerInfo consumerInfo)
    Creates a new AmqpSender instance that manages the given Sender
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    Request from the remote peer to close this resource.
    void
    commit(org.apache.activemq.command.LocalTransactionId txnId)
    Handle work necessary on commit of transacted resources associated with this Link instance.
    void
    delivery(org.apache.qpid.proton.engine.Delivery delivery)
    Called when a new Delivery arrives for the given Link.
    void
    Request from the remote peer to detach this resource.
    void
    Handles an incoming flow control.
    org.apache.activemq.command.ConsumerId
     
    org.apache.activemq.command.ActiveMQDestination
     
    void
    onConsumerControl(org.apache.activemq.command.ConsumerControl control)
    Called when the Broker sends a ConsumerControl command to the Consumer that this sender creates to obtain messages to dispatch via the sender for this end of the open link.
    void
    onMessageDispatch(org.apache.activemq.command.MessageDispatch dispatch)
    Event point for incoming message from ActiveMQ on this Sender's corresponding subscription.
    void
    Request from the remote peer to open this resource.
    void
     
    void
    rollback(org.apache.activemq.command.LocalTransactionId txnId)
    Handle work necessary on rollback of transacted resources associated with this Link instance.
    void
    setDestination(org.apache.activemq.command.ActiveMQDestination destination)
    Sets the ActiveMQDestination that this link will be servicing.
     
    addCloseAction, close, getEndpoint, getSession, isClosed, isOpened, sendToActiveMQ, sendToActiveMQ

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
  • Constructor Details

    • AmqpSender

      public AmqpSender(AmqpSession session, org.apache.qpid.proton.engine.Sender endpoint, org.apache.activemq.command.ConsumerInfo consumerInfo)
      Creates a new AmqpSender instance that manages the given Sender
      Parameters:
      session - the AmqpSession object that is the parent of this instance.
      endpoint - the AMQP Sender instance that this class manages.
      consumerInfo - the ConsumerInfo instance that holds configuration for this sender.
  • Method Details

    • open

      public void open()
      Description copied from interface: AmqpResource
      Request from the remote peer to open this resource.
      Specified by:
      open in interface AmqpResource
      Overrides:
      open in class AmqpAbstractLink<org.apache.qpid.proton.engine.Sender>
    • detach

      public void detach()
      Description copied from interface: AmqpLink
      Request from the remote peer to detach this resource.
      Specified by:
      detach in interface AmqpLink
      Overrides:
      detach in class AmqpAbstractLink<org.apache.qpid.proton.engine.Sender>
    • close

      public void close()
      Description copied from interface: AmqpResource
      Request from the remote peer to close this resource.
      Specified by:
      close in interface AmqpResource
      Overrides:
      close in class AmqpAbstractLink<org.apache.qpid.proton.engine.Sender>
    • flow

      public void flow() throws Exception
      Description copied from interface: AmqpLink
      Handles an incoming flow control.
      Throws:
      Exception
    • delivery

      public void delivery(org.apache.qpid.proton.engine.Delivery delivery) throws Exception
      Description copied from interface: AmqpLink
      Called when a new Delivery arrives for the given Link.
      Parameters:
      delivery - the newly arrived delivery on this link.
      Throws:
      Exception - if an error occurs while processing the new Delivery.
    • commit

      public void commit(org.apache.activemq.command.LocalTransactionId txnId) throws Exception
      Description copied from interface: AmqpLink
      Handle work necessary on commit of transacted resources associated with this Link instance.
      Parameters:
      txnId - The Transaction ID being committed.
      Throws:
      Exception - if an error occurs while performing the commit.
    • rollback

      public void rollback(org.apache.activemq.command.LocalTransactionId txnId) throws Exception
      Description copied from interface: AmqpLink
      Handle work necessary on rollback of transacted resources associated with this Link instance.
      Parameters:
      txnId - The Transaction ID being rolled back.
      Throws:
      Exception - if an error occurs while performing the rollback.
    • onMessageDispatch

      public void onMessageDispatch(org.apache.activemq.command.MessageDispatch dispatch) throws Exception
      Event point for incoming message from ActiveMQ on this Sender's corresponding subscription.
      Parameters:
      dispatch - the MessageDispatch to process and send across the link.
      Throws:
      Exception - if an error occurs while encoding the message for send.
    • onConsumerControl

      public void onConsumerControl(org.apache.activemq.command.ConsumerControl control)
      Called when the Broker sends a ConsumerControl command to the Consumer that this sender creates to obtain messages to dispatch via the sender for this end of the open link.
      Parameters:
      control - The ConsumerControl command to process.
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • getConsumerId

      public org.apache.activemq.command.ConsumerId getConsumerId()
    • getDestination

      public org.apache.activemq.command.ActiveMQDestination getDestination()
      Returns:
      the ActiveMQDestination that this link is servicing.
    • setDestination

      public void setDestination(org.apache.activemq.command.ActiveMQDestination destination)
      Description copied from interface: AmqpLink
      Sets the ActiveMQDestination that this link will be servicing.
      Parameters:
      destination - the ActiveMQDestination that this link services.
    • pumpOutbound

      public void pumpOutbound() throws Exception
      Throws:
      Exception