Interface Consumer.Context

Enclosing interface:
Consumer

public static interface Consumer.Context
Context for message processing.
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    Accept the message (AMQP 1.0 accepted outcome).
    void
    Discard the message (AMQP 1.0 rejected outcome).
    void
    discard(Map<String,Object> annotations)
    Discard the message with annotations to combine with the existing message annotations.
    void
    Requeue the message (AMQP 1.0 released outcome).
    void
    requeue(Map<String,Object> annotations)
    Requeue the message with annotations to combine with the existing message annotations.
  • Method Details

    • accept

      void accept()
      Accept the message (AMQP 1.0 accepted outcome).

      This means the message has been processed and the broker can delete it.

    • discard

      void discard()
      Discard the message (AMQP 1.0 rejected outcome).

      This means the message cannot be processed because it is invalid, the broker can drop it or dead-letter it if it is configured.

    • discard

      void discard(Map<String,Object> annotations)
      Discard the message with annotations to combine with the existing message annotations.

      This means the message cannot be processed because it is invalid, the broker can drop it or dead-letter it if it is configured.

      Annotation keys must start with the x-opt- prefix.

      This maps to the AMQP 1.0 modified{delivery-failed = true, undeliverable-here = true} outcome.

      Parameters:
      annotations - message annotations to combine with existing ones
      See Also:
    • requeue

      void requeue()
      Requeue the message (AMQP 1.0 released outcome).

      This means the message has not been processed and the broker can requeue it and deliver it to the same or a different consumer.

    • requeue

      void requeue(Map<String,Object> annotations)
      Requeue the message with annotations to combine with the existing message annotations.

      This means the message has not been processed and the broker can requeue it and deliver it to the same or a different consumer.

      Annotation keys must start with the x-opt- prefix.

      This maps to the AMQP 1.0 modified{delivery-failed = false, undeliverable-here = false} outcome.

      Parameters:
      annotations - message annotations to combine with existing ones
      See Also: