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
apiVersion: dapr.io/v1alpha1
kind: Component
name: servicebus-pubsub
spec:
type: pubsub.azure.servicebus.queues
version: v1
metadata:
- name: namespaceName
# Required when using Azure Authentication.
# Must be a fully-qualified domain name
- name: azureTenantId
value: "***"
- name: azureClientId
value: "***"
- name: azureClientSecret
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.
Related links
- Basic schema for a Dapr component
- Read this guide for instructions on configuring pub/sub components