Interface Message<T>

Type Parameters:
T - the decoded body type

public interface Message<T>
One message from a Queue.
Since:
1.0.0
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    ack()
    Marks this message delivered regardless of how the handler ends.
    int
    Returns how many times delivery has been attempted, starting at one.
    Returns the decoded body.
    id()
    Returns the system-generated message id.
    void
    Marks this message for redelivery in a later batch.
    void
    retry(int delaySeconds)
    Marks this message for redelivery after a delay.
    long
    Returns when the message was sent, in milliseconds since the epoch.
  • Method Details

    • id

      String id()
      Returns the system-generated message id.
      Returns:
      the system-generated message id
    • timestamp

      long timestamp()
      Returns when the message was sent, in milliseconds since the epoch.
      Returns:
      when the message was sent, in milliseconds since the epoch
    • attempts

      int attempts()
      Returns how many times delivery has been attempted, starting at one.
      Returns:
      how many times delivery has been attempted, starting at one
    • body

      T body()
      Returns the decoded body.
      Returns:
      the decoded body
    • ack

      void ack()
      Marks this message delivered regardless of how the handler ends.
    • retry

      void retry()
      Marks this message for redelivery in a later batch.
    • retry

      void retry(int delaySeconds)
      Marks this message for redelivery after a delay.
      Parameters:
      delaySeconds - how long to wait before redelivering