Class InboundDelivery

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

public final class InboundDelivery extends Object
A message handed up from the broker, still encoded.
  • Constructor Details

    • InboundDelivery

      public InboundDelivery(String queue, String exchange, String routingKey, byte[] body, @Nullable Map<String,Object> headers, @Nullable String messageId, @Nullable String contentType, boolean redelivered)
    • InboundDelivery

      public InboundDelivery(String queue, String exchange, String routingKey, byte[] body, @Nullable Map<String,Object> headers, @Nullable String messageId, @Nullable String contentType, boolean redelivered, @Nullable String replyTo)
      Parameters:
      replyTo - queue the sender asked for a reply on, or null when it expects none
  • Method Details

    • replyTo

      public Optional<String> replyTo()
      Where the sender asked for a reply.

      AMQP's own reply-to property, so this is set whether or not the sender used this library.

      Returns:
      the reply queue, when the sender named one
    • queue

      public String queue()
    • exchange

      public String exchange()
    • routingKey

      public String routingKey()
    • body

      public byte[] body()
    • headers

      public Map<String,Object> headers()
      Returns:
      the message headers
      Implementation Requirements:
      values must be portable types only: String, Number, Boolean, or a List or Map of those. Client libraries expose their own wrappers — the RabbitMQ client hands back LongString rather than String — and converting them is the transport's job. The core compares header values against ordinary Java types, and a client-specific wrapper that reaches it fails those comparisons in a way that is tedious to diagnose.
    • messageId

      public @Nullable String messageId()
    • contentType

      public @Nullable String contentType()
    • redelivered

      public boolean redelivered()
      Returns:
      the broker's redelivery flag
      Implementation Note:
      this is not the AceMQ attempt counter. A broker sets it after any recovery, including one unrelated to a handler failure, so it is a hint for operators rather than something retry policy should be built on.
    • toString

      public String toString()
      Overrides:
      toString in class Object