Service Bus Queue

With Queues, you can have multiple senders, but only one message-consumer receives and process each message.

Using queues to intermediate between message producers and consumers provides an inherent loose coupling between the components.

With Queues, there are two different modes available to process messages.

Received & Delete

This mode is suitable where the system can tolerate not processing messages in case of failure. In this mode, once the consumer service reads the message, it will be deleted from the Queue irrespective of the status of the message process.

Peek

This mode is suitable where the system cannot tolerate ignoring messages in case of failure. So here, messages are processed in two stages, as below.

  • Finds the next message to be consumed, locks it to prevent other consumers from receiving it, and then return the message to the application.
  • After the application finishes processing the message, it requests the Service Bus service to complete the second stage of the receiving process. Then, the service marks the message as being consumed.

Comments