Azure Service Bus Queues

    To setup Azure Service Bus Queues pubsub create a component of type . See on how to create and apply a pubsub configuration.

    Warning

    The above example uses secrets as plain strings. It is recommended to use a secret store for the secrets as described here.

    Spec metadata fields

    Azure Active Directory (AAD) authentication

    The Azure Service Bus Queues pubsub component supports authentication using all Azure Active Directory mechanisms, including Managed Identities. For further information and the relevant component metadata fields to provide depending on the choice of AAD authentication mechanism, see the .

    Example Configuration

    1. apiVersion: dapr.io/v1alpha1
    2. kind: Component
    3. name: servicebus-pubsub
    4. spec:
    5. type: pubsub.azure.servicebus.queues
    6. version: v1
    7. metadata:
    8. - name: namespaceName
    9. # Required when using Azure Authentication.
    10. # Must be a fully-qualified domain name
    11. - name: azureTenantId
    12. value: "***"
    13. - name: azureClientId
    14. value: "***"
    15. - name: azureClientSecret
    16. value: "***"

    To set Azure Service Bus metadata when sending a message, set the query parameters on the HTTP request or the gRPC metadata as documented .

    • metadata.MessageId
    • metadata.SessionId
    • metadata.Label
    • metadata.ReplyTo
    • metadata.PartitionKey
    • metadata.To
    • metadata.ContentType
    • metadata.ScheduledEnqueueTimeUtc
    • metadata.ReplyToSessionId

    Receiving a message with metadata

    When Dapr calls your application, it will attach Azure Service Bus message metadata to the request using either HTTP headers or gRPC metadata. In addition to the , you can also access the following read-only message metadata.

    • metadata.DeliveryCount
    • metadata.LockedUntilUtc
    • metadata.LockToken
    • metadata.EnqueuedTimeUtc
    • metadata.SequenceNumber

    To find out more details on the purpose of any of these metadata properties, please refer to the official Azure Service Bus documentation.

    Sending and receiving multiple messages

    Azure Service Bus supports sending and receiving multiple messages in a single operation using the bulk pub/sub API.

    To set the metadata for bulk publish operation, set the query parameters on the HTTP request or the gRPC metadata as documented

    Configuring bulk subscribe

    When subscribing to a topic, you can configure bulkSubscribe options. Refer to for more details. Learn more about the bulk subscribe API.

    Follow the instructions here on setting up Azure Service Bus Queues.