Interface Consumer.Context
- Enclosing interface:
Consumer
-
Method Summary
Modifier and TypeMethodDescriptionvoid
accept()
Accept the message (AMQP 1.0accepted
outcome).void
discard()
Discard the message (AMQP 1.0rejected
outcome).void
Discard the message with annotations to combine with the existing message annotations.void
requeue()
Requeue the message (AMQP 1.0released
outcome).void
Requeue the message with annotations to combine with the existing message annotations.
-
Method Details
-
accept
void accept()Accept the message (AMQP 1.0accepted
outcome).This means the message has been processed and the broker can delete it.
-
discard
void discard()Discard the message (AMQP 1.0rejected
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
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.
Application-specific annotation keys must start with the
x-opt-
prefix. Annotation keys the broker understands start withx-
, but not withx-opt-
.This maps to the AMQP 1.0
modified{delivery-failed = true, undeliverable-here = true}
outcome.Only quorum queues support the modification of message annotations with the
modified
outcome.- Parameters:
annotations
- message annotations to combine with existing ones- See Also:
-
requeue
void requeue()Requeue the message (AMQP 1.0released
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
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.
Application-specific annotation keys must start with the
x-opt-
prefix. Annotation keys the broker understands start withx-
, but not withx-opt-
.This maps to the AMQP 1.0
modified{delivery-failed = false, undeliverable-here = false}
outcome.Only quorum queues support the modification of message annotations with the
modified
outcome.- Parameters:
annotations
- message annotations to combine with existing ones- See Also:
-