The documentation you are viewing is for Dapr v1.0 which is an older version of Dapr. For up-to-date documentation, see the latest version.

Azure Service Bus

Detailed documentation on the Azure Service Bus pubsub component

Component format

To setup Azure Event Hubs pubsub create a component of type pubsub.azure.servicebus. See this guide on how to create and apply a pubsub configuration.

apiVersion: dapr.io/v1alpha1
kind: Component
metadata:
  name: servicebus-pubsub
  namespace: default
spec:
  type: pubsub.azure.servicebus
  version: v1
  metadata:
  - name: connectionString # Required
    value: "Endpoint=sb://{ServiceBusNamespace}.servicebus.windows.net/;SharedAccessKeyName={PolicyName};SharedAccessKey={Key};EntityPath={ServiceBus}"
  - name: timeoutInSec # Optional
    value: 60
  - name: handlerTimeoutInSec # Optional
    value: 60
  - name: disableEntityManagement # Optional
    value: "false" 
  - name: maxDeliveryCount # Optional
    value: 3
  - name: lockDurationInSec # Optional
    value: 60 
  - name: lockRenewalInSec # Optional
    value: 20 
  - name: maxActiveMessages # Optional
    value: 2000 
  - name: maxActiveMessagesRecoveryInSec # Optional
    value: 2 
  - name: maxConcurrentHandlers # Optional
    value: 10
  - name: prefetchCount # Optional
    value: 5
  - name: defaultMessageTimeToLiveInSec # Optional
    value: 10
  - name: autoDeleteOnIdleInSec # Optional
    value: 10

NOTE: The above settings are shared across all topics that use this component.

Spec metadata fields

Field Required Details Example
connectionString Y Connection-string for the Event Hubs Endpoint=sb://{ServiceBusNamespace}.servicebus.windows.net/;SharedAccessKeyName={PolicyName};SharedAccessKey={Key};EntityPath={ServiceBus}
timeoutInSec N Timeout for sending messages and management operations. Default: 60 30
handlerTimeoutInSec N Timeout for invoking app handler. # Optional. Default: 60 30
disableEntityManagement N When set to true, topics and subscriptions do not get created automatically. Default: "false" "true", "false"
maxDeliveryCount N Defines the number of attempts the server will make to deliver a message. Default set by server 10
lockDurationInSec N Defines the length in seconds that a message will be locked for before expiring. Default set by server 30
lockRenewalInSec N Defines the frequency at which buffered message locks will be renewed. Default: 20. 20
maxActiveMessages N Defines the maximum number of messages to be buffered or processing at once. Default: 10000 2000
maxActiveMessagesRecoveryInSec N Defines the number of seconds to wait once the maximum active message limit is reached. Default: 2 10
maxConcurrentHandlers N Defines the maximum number of concurrent message handlers 10
prefetchCount N Defines the number of prefetched messages (use for high throughput / low latency scenarios) 5
defaultMessageTimeToLiveInSec N Default message time to live. 10
autoDeleteOnIdleInSec N Time in seconds to wait before auto deleting messages. 10

Create an Azure Service Bus

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

Last modified July 8, 2022: update nav bar for v1.0 (#2634) (7fd6223)