33// Copyright (c) 2017-2023 Broadcom. All Rights Reserved. The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries.
44
55using System ;
6+ using System . Collections . Generic ;
67using System . Threading . Tasks ;
78
89namespace RabbitMQ . AMQP . Client
@@ -25,8 +26,66 @@ public interface IConsumer : ILifeCycle
2526
2627 public interface IContext
2728 {
29+ ///<summary>
30+ /// Accept the message (AMQP 1.0 <code>accepted</code> outcome).
31+ ///
32+ /// This means the message has been processed and the broker can delete it.
33+ ///
34+ /// </summary>
2835 Task AcceptAsync ( ) ;
36+
37+ ///<summary>
38+ /// Discard the message (AMQP 1.0 <code>rejected</code> outcome).
39+ ///This means the message cannot be processed because it is invalid, the broker can drop it
40+ /// or dead-letter it if it is configured.
41+ ///</summary>
2942 Task DiscardAsync ( ) ;
43+
44+ ///<summary>
45+ ///Discard the message with annotations to combine with the existing message annotations.
46+ ///This means the message cannot be processed because it is invalid, the broker can drop it
47+ ///or dead-letter it if it is configured.
48+ ///Application-specific annotation keys must start with the <code>x-opt-</code> prefix.
49+ ///Annotation keys the broker understands starts with <code>x-</code>, but not with <code>x-opt-
50+ ///</code>.
51+ ///This maps to the AMQP 1.0 <code>
52+ ///modified{delivery-failed = true, undeliverable-here = true}</code> outcome.
53+ /// <param name="annotations"> annotations message annotations to combine with existing ones </param>
54+ ///<a
55+ /// href="https://docs.oasis-open.org/amqp/core/v1.0/os/amqp-core-messaging-v1.0-os.html#type-modified">AMQP
56+ /// 1.0 <code>modified</code> outcome</a>
57+ ///
58+ /// The annotations can be used only with Quorum queues, see https://www.rabbitmq.com/docs/amqp#modified-outcome
59+ ///</summary>
60+ Task DiscardAsync ( Dictionary < string , object > annotations ) ;
61+ ///<summary>
62+ ///Requeue the message (AMQP 1.0 <code>released</code> outcome).
63+ ///
64+ ///This means the message has not been processed and the broker can requeue it and deliver it
65+ /// to the same or a different consumer.
66+ ///
67+ /// </summary>
3068 Task RequeueAsync ( ) ;
69+
70+ ///<summary>
71+ ///Requeue the message with annotations to combine with the existing message annotations.
72+ ///
73+ ///This means the message has not been processed and the broker can requeue it and deliver it
74+ /// to the same or a different consumer.
75+ /// Application-specific annotation keys must start with the <code>x-opt-</code> prefix.
76+ /// Annotation keys the broker understands starts with <code>x-</code>, but not with <code>x-opt-
77+ /// </code>.
78+ ///
79+ /// This maps to the AMQP 1.0 <code>
80+ /// modified{delivery-failed = false, undeliverable-here = false}</code> outcome.
81+ ///
82+ /// <param name="annotations"> annotations message annotations to combine with existing ones </param>
83+ ///<a
84+ /// href="https://docs.oasis-open.org/amqp/core/v1.0/os/amqp-core-messaging-v1.0-os.html#type-modified">AMQP
85+ /// 1.0 <code>modified</code> outcome</a>
86+ ///
87+ ///The annotations can be used only with Quorum queues, see https://www.rabbitmq.com/docs/amqp#modified-outcome
88+ ///</summary>
89+ Task RequeueAsync ( Dictionary < string , object > annotations ) ;
3190 }
3291}
0 commit comments