0 votes
in Azure by
Compare different message receiving modes in queuing technology

1 Answer

0 votes
by

Receive Mode is the way in which messages can be retrieved from a queuing technology by a consumer:

  1. Peek & Lease. Used by Azure Storage Queues. The lease duration is associated with the message, so is something that you specify when you send the message to the queue. Once a message is picked up by a consumer, it is not removed from the queue. Instead, a lease (i.e. time-based limit) is placed on the message (on the message level), before it is available for another consumer to process. So in case a service that is holding a resource dies, the resource is freed after the set timeout, and the scenario of deadlock is avoided.
  2. Peek & Lock. Used by Azure Service Bus. The message is held in the queue, but a lock is put on the message which is held exclusively by the consumer. The lock can be renewed if needed. By default, this is set at 30 seconds but can be changed.
  3. Receive & Delete. Used by Azure Service Bus. The message is considered consumed as soon as the Service Bus has transferred the message (i.e. the consuming application won’t be able to guarantee that the message has been fully processed. So if there’s an issue mid-processing, then the message could be lost). This scenario makes sense if the messages are low-value, but makes little sense in the banking scenario that we outlined earlier.

...