Search code examples
masstransit

Is there sequence guarantee in Batch after reconnected?


If I accepted Batch, and then the connection of the consumer with the broker was broken, is there any guarantee that the same messages will get into the Batch when the consumer is reconnected? For example, if new messages were added to the queue after the consumer connection was disconnected, will these new messages get into the batch to the old messages that were in the batch before the connection was disconnected


Solution

  • There is no guarantee of order or content, if new messages were added to the queue and they fit within the batch criteria, they would be added to the batch as well.

    Batching is a consumption-side construct of MassTransit to allow multiple messages to be consumed "as a batch" to easy set up and tear down of things like database transactions (to speed up inserts).