Azure Queue 和 Service Bus Queue的比较
| Comparison Criteria | Windows Azure Queues | Service Bus Queues |
| Message Class Name | CloudQueueMessage | BrokeredMessage |
| Send Method Name | CloudQueue.AddMessage() | QueueClient.Send()
|
| Queue Size | ApproximateMessageCount |
|
| How to Create Queue | // Retrieve storage account from connection string. // Create the queue client. // Retrieve a reference to a queue. // Create the queue if it doesn't already exist. | QueueDescription qd = new QueueDescription("TestQueue"); // Create a new Queue with custom settings var namespaceManager = if (!namespaceManager.QueueExists("TestQueue")) |
| How to Send message | // Create a message and add it to the queue.
| string connectionString = CloudConfigurationManager.GetSetting("Microsoft.ServiceBus.ConnectionString"); QueueClient Client = QueueClient.CreateFromConnectionString(connectionString, "TestQueue"); Client.Send(new BrokeredMessage()); |
| How to Receive Message | // Get the next message //Process the message in less than 30 seconds, and then delete the message | BrokeredMessage message = Client.Receive(); if (message != null) |
| Comparison Criteria | Windows Azure Queues | Service Bus Queues |
| Ordering guarantee | No | Yes - First-In-First-Out (FIFO) (through the use of messaging sessions) |
| Delivery guarantee | At-Least-Once | At-Least-Once At-Most-Once |
| Transaction support | No | Yes (through the use of local transactions) |
| 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) |
| Receive mode | Peek & Lease | Peek & Lock Receive & Delete |
| Exclusive access mode | Lease-based | Lock-based |
| Lease/Lock duration | 30 seconds (default) 7 days (maximum) | 60 seconds (default) 5 minutes (maximum) |
| Lease/Lock granularity | Message level (each message can have a different timeout value) | Queue level (each queue has a lock granularity applied to all of its messages, fixed for the lifetime of the queue) |
| 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) |
| Comparison Criteria | Windows Azure Queues | Service Bus Queues |
| Scheduled delivery | Yes | Yes |
| Automatic dead lettering | No | Yes |
| Message deferral | Yes (via in-place update of visibility timeout) | Yes (provided via a dedicated API function) |
| Poison message support | Yes | Yes |
| In-place update | Yes | No |
| Server-side transaction log | Yes | No |
| Storage metrics | Yes | No |
| Purge queue function | Yes | No |
| Message groups | No | Yes (through the use of messaging sessions) |
| Duplicate detection | No | Yes (configurable on the sender side) |
| WCF integration | No | Yes (offers out-of-the-box WCF bindings) |
| WF integration | Custom (requires building a custom WF activity) | Native (offers out-of-the-box WF activities) |
| Comparison Criteria | Windows Azure Queues | Service Bus Queues |
| Maximum message size | 64 KB (48 KB when using Base64 encoding) | 256 KB (including both header and body, maximum header size: 64 KB) |
| Maximum queue size | 100 TB (limited to a single storage account capacity) | 1, 2, 3, 4 or 5 GB (defined upon creation of a queue) |
| Maximum message TTL | 7 days | Unlimited |
| Maximum number of queues | Unlimited | 10,000 (per service namespace, can be increased) |
| Maximum number of concurrent clients | Unlimited | Unlimited (100 concurrent connection limit only applies to TCP protocol-based communication) |
| Comparison Criteria | Windows Azure Queues | Service Bus Queues |
| Management protocol | REST over HTTP/HTTPS | REST over HTTPS |
| Runtime protocol | REST over HTTP/HTTPS | REST over HTTPS TCP with TLS |
| .NET Managed API | Yes (.NET managed Storage Client API) | Yes (.NET managed brokered messaging API) |
| Java API | Yes | Yes |
| PHP API | Yes | Yes |
| Node.js API | Yes | No |
| Arbitrary metadata support | Yes | No |
| Queue naming rules | Up to 63 characters long [3,63] (letters in a queue name must be lowercase) | Up to 260 characters long (queue names are case-insensitive) |
| Get queue length function | Yes (approximate value) | Yes (exact, point-in-time value) |
| Peek function | Yes | No |
| Comparison Criteria | Windows Azure Queues | Service Bus Queues |
| Maximum throughput | Up to 2,000 messages per second | Up to 2,000 messages per second (based on benchmark with 1 KB messages) |
| Average latency | 10 ms (with TCP Nagle disabled) | 100 ms |
| Throttling behavior | Reject with HTTP 503 code (throttled requests are not treated as billable) | Reject with exception/HTTP 503 (throttled requests are not treated as billable) |
| Comparison Criteria | Windows Azure Queues | Service Bus Queues |
| Authentication | Symmetric key | ACS claims |
| Role-based access control | No | Yes (through the use of ACS roles) |
| Identity provider federation | No | Yes |
工作流程
Azure Queue Message 流程
Service Bus Queue




浙公网安备 33010602011771号