Interface IBatchSettlement<TItem>
How a broker settles the messages of a batch: the one part of batch mode that differs by broker. Kafka settles by
position (the last offset of each partition covers the earlier ones); the other brokers settle each message (a
delivery tag, a receipt, a lock token). calls exactly one of
, or per batch, once the route has
returned.
public interface IBatchSettlement<TItem>
Methods
AcceptAsync(IExchange, IReadOnlyList<TItem>, CancellationToken)
The route succeeded: settle every message as consumed.
ValueTask AcceptAsync(IExchange batch, IReadOnlyList<TItem> items, CancellationToken ct)
BeforeRouteAsync(IExchange, IReadOnlyList<TItem>, CancellationToken)
Called after the batch exchange is built and before the route runs, with the scope the route runs in: a
ValueTask<IDisposable?> BeforeRouteAsync(IExchange batch, IReadOnlyList<TItem> items, CancellationToken ct)
RejectAsync(IExchange, IReadOnlyList<TItem>, Exception, CancellationToken)
The route failed: settle the messages by the connector's rule for a failed single message, applied to every
ValueTask RejectAsync(IExchange batch, IReadOnlyList<TItem> items, Exception failure, CancellationToken ct)
ReturnAsync(IReadOnlyList<TItem>, CancellationToken)
The batch did not run to an outcome: the consumer stopped while collecting it, or cancelled it while it ran.
ValueTask ReturnAsync(IReadOnlyList<TItem> items, CancellationToken ct)