Interface IContext
public interface IContext
Methods
Accept()
Accept the message (AMQP 1.0 accepted outcome).
This means the message has been processed and the broker can delete it.
void Accept()
Batch()
Create a batch context to accumulate message contexts and settle them at once. The message context the batch context is created from is not added to the batch context. @return the created batch context
IBatchContext Batch()
Returns
DelayedRetry(TimeSpan, bool)
Requeue the message with an explicit per-message delivery delay
(AMQP 1.0 modified{delivery-failed = true/false, undeliverable-here = false} outcome),
overriding the queue-level back-off for this specific delivery.
The delay is sent to the broker as the
x-opt-delivery-time message annotation (absolute Unix timestamp in
milliseconds = DateTimeOffset.UtcNow + delay).
void DelayedRetry(TimeSpan delay, bool deliveryFailed = false)
Parameters
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.
void Discard()
Discard(Dictionary<string, object>)
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 that the broker understands start with x-
This maps to the AMQP 1.0 modified{delivery-failed = false,
undeliverable-here = false} outcome.
void Discard(Dictionary<string, object> annotations)
Parameters
annotationsDictionary<string, object>
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.
void Requeue()
Requeue(Dictionary<string, object>, bool)
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 that the broker understands start with x-.
This maps to the AMQP 1.0 modified{delivery-failed = false,
undeliverable-here = false} outcome.
void Requeue(Dictionary<string, object> annotations, bool deliveryFailed = false)
Parameters
annotationsDictionary<string, object>deliveryFailedbool