Azure Service Bus

Detailed documentation on the Azure Service Bus pubsub component

Component format

To setup Azure Service Bus 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
  - name: maxReconnectionAttempts # Optional
    value: 30
  - name: connectionRecoveryInSec # Optional
    value: 2
  - name: publishMaxRetries # Optional
    value: 5
  - name: publishInitialRetryInternalInMs # Optional
    value: 500

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

Spec metadata fields

FieldRequiredDetailsExample
connectionStringYConnection-string for the Service BusEndpoint=sb://{ServiceBusNamespace}.servicebus.windows.net/;SharedAccessKeyName={PolicyName};SharedAccessKey={Key};EntityPath={ServiceBus}
timeoutInSecNTimeout for sending messages and management operations. Default: 6030
handlerTimeoutInSecNTimeout for invoking app handler. # Optional. Default: 6030
disableEntityManagementNWhen set to true, topics and subscriptions do not get created automatically. Default: "false""true", "false"
maxDeliveryCountNDefines the number of attempts the server will make to deliver a message. Default set by server10
lockDurationInSecNDefines the length in seconds that a message will be locked for before expiring. Default set by server30
lockRenewalInSecNDefines the frequency at which buffered message locks will be renewed. Default: 20.20
maxActiveMessagesNDefines the maximum number of messages to be buffered or processing at once. Default: 100002000
maxActiveMessagesRecoveryInSecNDefines the number of seconds to wait once the maximum active message limit is reached. Default: 210
maxConcurrentHandlersNDefines the maximum number of concurrent message handlers10
prefetchCountNDefines the number of prefetched messages (use for high throughput / low latency scenarios)5
defaultMessageTimeToLiveInSecNDefault message time to live.10
autoDeleteOnIdleInSecNTime in seconds to wait before auto deleting messages.10
maxReconnectionAttemptsNDefines the maximum number of reconnect attempts. Default: 3030
connectionRecoveryInSecNTime in seconds to wait between connection recovery attempts. Defaults: 22
publishMaxRetriesNThe max number of retries for when Azure Service Bus responds with “too busy” in order to throttle messages. Defaults: 55
publishInitialRetryInternalInMsNTime in milliseconds for the initial exponential backoff when Azure Service Bus throttle messages. Defaults: 500500

Create an Azure Service Bus

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