Interface EmgDelivery


public interface EmgDelivery
One message received in peek-lock mode, together with its settlement operations. Exactly one settlement method should be called per delivery; implementations may throw if the lock has been lost, in which case the broker redelivers the message after the lock expires.
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    Releases the lock without processing: the broker redelivers the message.
    byte[]
    The raw message body.
    void
    Settles the message as processed: the broker deletes it.
    void
    deadLetter(String reason, String description)
    Moves the message to the dead-letter sub-queue, where it is kept for inspection and never redelivered.
    long
    How many times the broker has delivered this message (1 on first delivery).
    The broker's message id, for logging.
  • Method Details

    • body

      byte[] body()
      The raw message body.
      Returns:
      the body bytes (UTF-8 JSON for EMG)
    • messageId

      String messageId()
      The broker's message id, for logging. Not a secret; never the body.
      Returns:
      the broker message id, may be null
    • deliveryCount

      long deliveryCount()
      How many times the broker has delivered this message (1 on first delivery).
      Returns:
      the delivery count
    • complete

      void complete()
      Settles the message as processed: the broker deletes it.
    • abandon

      void abandon()
      Releases the lock without processing: the broker redelivers the message.
    • deadLetter

      void deadLetter(String reason, String description)
      Moves the message to the dead-letter sub-queue, where it is kept for inspection and never redelivered.
      Parameters:
      reason - short machine-readable reason
      description - human-readable detail (must not contain payload or secrets)