Class PulledMessage

java.lang.Object
org.acemq.amqp.transport.PulledMessage

public final class PulledMessage extends Object
One message taken off a queue by TransportConnection.receive(java.lang.String, java.time.Duration), and the means to settle it.

The two travel together because they are useless apart: a delivery nobody can acknowledge stays unsettled until the connection drops, and an acknowledger with no delivery has nothing to settle. A subscription gets them as two arguments to a listener; a pull has no listener, so it gets them as one object.

  • Constructor Details

    • PulledMessage

      public PulledMessage(InboundDelivery delivery, Acknowledger acknowledger)
      Parameters:
      delivery - the message
      acknowledger - settles it exactly once
  • Method Details

    • delivery

      public InboundDelivery delivery()
      Returns:
      the message
    • acknowledger

      public Acknowledger acknowledger()
      Returns:
      how to settle it; must be called exactly once
    • toString

      public String toString()
      Overrides:
      toString in class Object