Azure Service Bus Topics

    To setup Azure Service Bus Topics 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

    Example Configuration

    1. apiVersion: dapr.io/v1alpha1
    2. kind: Component
    3. metadata:
    4. name: servicebus-pubsub
    5. type: pubsub.azure.servicebus.topics
    6. version: v1
    7. metadata:
    8. - name: namespaceName
    9. # Required when using Azure Authentication.
    10. value: "servicebusnamespace.servicebus.windows.net"
    11. - name: azureTenantId
    12. value: "***"
    13. - name: azureClientId
    14. value: "***"
    15. - name: azureClientSecret
    16. value: "***"

    Azure Service Bus messages extend the Dapr message format with additional contextual metadata. Some metadata fields are set by Azure Service Bus itself (read-only) and others can be set by the client when publishing a message.

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

    • metadata.MessageId
    • metadata.CorrelationId
    • metadata.SessionId
    • metadata.ReplyTo
    • metadata.PartitionKey
    • metadata.To
    • metadata.ContentType
    • metadata.ScheduledEnqueueTimeUtc
    • metadata.ReplyToSessionId
    • 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.

    Subscribe to a session enabled topic

    To subscribe to a topic that has sessions enabled you can provide the following properties in the subscription metadata.

    • requireSessions (default: false)
    • sessionIdleTimeoutInSec (default: 60)
    • maxConcurrentSessions (default: 8)

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