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
apiVersion: dapr.io/v1alpha1
kind: Component
metadata:
name: servicebus-pubsub
type: pubsub.azure.servicebus.topics
version: v1
metadata:
- name: namespaceName
# Required when using Azure Authentication.
value: "servicebusnamespace.servicebus.windows.net"
- name: azureTenantId
value: "***"
- name: azureClientId
value: "***"
- name: azureClientSecret
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.