@@ -169,6 +169,9 @@ public class BatchDeliveryContext : IBatchContext
169169 private readonly List < IContext > _contexts = new ( ) ;
170170 private readonly SemaphoreSlim _semaphore = new ( 1 , 1 ) ;
171171
172+ ///<summary>
173+ /// Accept all messages in the batch context (AMQP 1.0 <c>accepted</c> outcome).
174+ /// </summary>
172175 public void Accept ( )
173176 {
174177 _semaphore . Wait ( ) ;
@@ -187,6 +190,9 @@ public void Accept()
187190 }
188191 }
189192
193+ ///<summary>
194+ /// Discard all messages in the batch context (AMQP 1.0 <c>rejected</c> outcome).
195+ /// </summary>
190196 public void Discard ( )
191197 {
192198 _semaphore . Wait ( ) ;
@@ -205,6 +211,9 @@ public void Discard()
205211 }
206212 }
207213
214+ ///<summary>
215+ /// Discard all messages in the batch context with annotations
216+ /// </summary>
208217 public void Discard ( Dictionary < string , object > annotations )
209218 {
210219 _semaphore . Wait ( ) ;
@@ -225,6 +234,9 @@ public void Discard(Dictionary<string, object> annotations)
225234 }
226235 }
227236
237+ ///<summary>
238+ /// Requeue all messages in the batch context (AMQP 1.0 <c>released</c> outcome).
239+ /// </summary>
228240 public void Requeue ( )
229241 {
230242 _semaphore . Wait ( ) ;
@@ -243,13 +255,14 @@ public void Requeue()
243255 }
244256 }
245257
258+ ///<summary>
259+ /// Requeue all messages in the batch context with annotations
260+ /// </summary>
246261 public void Requeue ( Dictionary < string , object > annotations )
247262 {
248263 _semaphore . Wait ( ) ;
249264 try
250265 {
251- Utils . ValidateMessageAnnotations ( annotations ) ;
252-
253266 foreach ( var context in _contexts )
254267 {
255268 context . Requeue ( annotations ) ;
@@ -265,11 +278,17 @@ public void Requeue(Dictionary<string, object> annotations)
265278
266279 public IBatchContext Batch ( ) => this ;
267280
281+ ///<summary>
282+ /// Add a message context to the batch context.
283+ /// </summary>
268284 public void Add ( IContext context )
269285 {
270286 _contexts . Add ( context ) ;
271287 }
272288
289+ ///<summary>
290+ /// Returns the number of message contexts in the batch context.
291+ /// </summary>
273292 public int Count ( ) => _contexts . Count ;
274293 }
275294}
0 commit comments