Comparison Criteria | Storage queues | Service Bus queues |
---|---|---|
Ordering guarantee | No . Messages in Storage queues are typically first-in-first-out, but sometimes they can be out of order; for example, when a message's visibility timeout duration expires (for example, as a result of a client application crashing during processing). When the visibility timeout expires, the message becomes visible again on the queue for another worker to dequeue it. At that point, the newly visible message might be placed in the queue (to be dequeued again) after a message that was originally enqueued after it. | Yes - First-In-First-Out (FIFO) (through the use of messaging sessions) |
Delivery guarantee | At-Least-Once | At-Least-Once (using PeekLock receive mode - this is the default) At-Most-Once (using ReceiveAndDelete receive mode) Learn more about various Receive modes |
Atomic operation support | No | Yes |
Receive behavior | Non-blocking (completes immediately if no new message is found) | Blocking with/without timeout (offers long polling, or the "Comet technique") Non-blocking (through the use of .NET managed API only) |
Push-style API | No | Yes OnMessage and OnMessage sessions .NET API. |
Receive mode | Peek & Lease | Peek & Lock Receive & Delete |
Exclusive access mode | Lease-based | Lock-based |
Lease/Lock duration | 30 seconds (default) 7 days (maximum) (You can renew or release a message lease using the UpdateMessage API.) | 60 seconds (default) You can renew a message lock using the RenewLock API. |
Lease/Lock precision | Message level (each message can have a different timeout value, which you can then update as needed while processing the message, by using the UpdateMessage API) | Queue level (each queue has a lock precision applied to all of its messages, but you can renew the lock using the RenewLock API.) |
Batched receive | Yes (explicitly specifying message count when retrieving messages, up to a maximum of 32 messages) | Yes (implicitly enabling a pre-fetch property or explicitly through the use of transactions) |
Batched send | No | Yes (through the use of transactions or client-side batching) |
Infrastructure | Part of the Azure storage infrastructure, feature a simple REST-based GET/PUT/PEEK interface, providing reliable, persistent messaging within and between services. | Part of a broader Azure messaging infrastructure that supports queuing as well as publish/subscribe, and more advanced integration patterns. |
When to use |
|
|
Monday, August 26, 2019
Azure Queue or Azure Service Bus Queue
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment