Edit

Share via


Azure Service Bus - advanced features

Service Bus includes advanced features that help you solve more complex messaging problems. This article describes several of these features.

Message sessions

To create a first-in, first-out (FIFO) guarantee in Service Bus, use sessions. Message sessions enable exclusive, ordered handling of unbounded sequences of related messages. To support handling sessions in high-scale, high-availability systems, the session feature also supports storing session state, which allows sessions to safely move between handlers. For more information, see Message sessions: first in, first out (FIFO).

Autoforwarding

The autoforwarding feature chains a queue or subscription to another queue or topic inside the same namespace. When you use this feature, Service Bus automatically moves messages from a queue or subscription to a target queue or topic. All such moves are done transactionally. For more information, see Chaining Service Bus entities with autoforwarding.

Dead-letter queue

All Service Bus queues and topics' subscriptions have associated dead-letter queues (DLQ). A DLQ holds messages that meet the following criteria:

  • They can't be delivered successfully to any receiver.
  • They timed out.
  • They're explicitly sidelined by the receiving application.

Messages in the dead-letter queue are annotated with the reason why they're placed there. The dead-letter queue has a special endpoint, but otherwise acts like any regular queue. An application or tool can browse a DLQ or dequeue from it. You can also autoforward out of a dead-letter queue. For more information, see Overview of Service Bus dead-letter queues.

Scheduled delivery

You can submit messages to a queue or a topic for delayed processing, setting a time when the message becomes available for consumption. You can also cancel scheduled messages. For more information, see Scheduled messages.

Message deferral

A queue or subscription client can defer retrieval of a received message until a later time. The message might be posted out of an expected order and the client wants to wait until it receives another message. Deferred messages remain in the queue or subscription and must be reactivated explicitly by using their service-assigned sequence number. For more information, see Message deferral.

Transactions

A transaction groups two or more operations together into an execution scope. Service Bus allows you to group operations against multiple messaging entities within the scope of a single transaction. A message entity can be a queue, topic, or subscription. For more information, see Overview of Service Bus transaction processing.

Autodelete on idle

Autodelete on idle enables you to specify an idle interval after which a queue or topic subscription is automatically deleted. The interval resets when a message is added to or removed from the subscription. The minimum duration is 5 minutes. For an overview on what is considered as idleness for entities, see Idleness.

Duplicate detection

The duplicate detection feature enables the sender to resend the same message and the broker to drop a potential duplicate. For more information, see Duplicate detection.

Batch deletion of messages

Azure Service Bus supports deletion of messages in batches. This feature is useful when messages within queues or subscriptions become expired or no longer relevant, necessitating a cleanup. For more information, see Batch delete.

Support ordering

The Support ordering feature allows you to specify whether messages that you send to a topic are forwarded to the subscription in the same order in which you sent them. This feature doesn't support partitioned topics. For more information, see TopicProperties.SupportOrdering in .NET or TopicProperties.setOrderingSupported in Java.

Geo-Replication

When an Azure region experiences downtime, the Geo-Replication feature enables message processing to continue operating in a different region. The feature keeps a structural mirror of a namespace and its data available in secondary regions and allows the namespace to switch to any of these regions. For more information, see Azure Service Bus Geo-Replication. This feature is one of the options to insulate Azure Service Bus applications against outages and disasters.

Security

Service Bus supports standard Advanced Message Queuing Protocol (AMQP) 1.0 and HTTP or REST protocols and their respective security facilities, including transport-level security (TLS). You can authorize clients for access by using Shared Access Signature or Microsoft Entra ID role-based security.

For protection against unwanted traffic, Service Bus provides security features such as IP firewall and integration with virtual networks.

See Service Bus messaging samples that show how to use these Service Bus features.