Class AmqpProducer

java.lang.Object
org.apache.qpid.jms.provider.amqp.AmqpAbstractResource<JmsProducerInfo,org.apache.qpid.proton.engine.Sender>
org.apache.qpid.jms.provider.amqp.AmqpProducer
All Implemented Interfaces:
AmqpEventSink, AmqpResource
Direct Known Subclasses:
AmqpAnonymousFallbackProducer, AmqpFixedProducer

public abstract class AmqpProducer extends AmqpAbstractResource<JmsProducerInfo,org.apache.qpid.proton.engine.Sender>
Base class for Producer instances.
  • Field Details

    • session

      protected final AmqpSession session
    • connection

      protected final AmqpConnection connection
    • presettle

      protected boolean presettle
    • delayedDeliverySupported

      protected boolean delayedDeliverySupported
  • Constructor Details

  • Method Details

    • send

      public abstract void send(JmsOutboundMessageDispatch envelope, AsyncResult request) throws ProviderException
      Sends the given message
      Parameters:
      envelope - The envelope that contains the message and it's targeted destination.
      request - The AsyncRequest that will be notified on send success or failure.
      Throws:
      ProviderException - if an error occurs sending the message
    • isAnonymous

      public abstract boolean isAnonymous()
      Returns:
      true if this is an anonymous producer or false if fixed to a given destination.
    • getProducerId

      public JmsProducerId getProducerId()
      Returns:
      the JmsProducerId that was assigned to this AmqpProducer.
    • isPresettle

      public boolean isPresettle()
      Returns:
      true if the producer should presettle all sent messages.
    • setPresettle

      public void setPresettle(boolean presettle)
      Sets whether the producer will presettle all messages that it sends. Sending presettled reduces the time it takes to send a message but increases the change of message loss should the connection drop during send.
      Parameters:
      presettle - true if all messages are sent settled.
    • setDelayedDeliverySupported

      public void setDelayedDeliverySupported(boolean delayedDeliverySupported)