Skip to main content

Azure Service Bus Queues

Type: bindings.azure.servicebus.queues

Status: stable

Reference: https://docs.dapr.io/reference/components-reference/supported-bindings/servicebusqueues/

Example

apiVersion: cra.diagrid.io/v1beta1
kind: Component
metadata:
name: <name>
spec:
type: bindings.azure.servicebus.queues
version: v1
metadata:
# The Service Bus connection string.
- name: connectionString
value: "Endpoint=sb://{ServiceBusNamespace}.servicebus.windows.net/;SharedAccessKeyName={PolicyName};SharedAccessKey={Key};EntityPath={ServiceBus}"
# Indicates the direction of the binding component.
- name: direction
value: "input,output"
# The Service Bus queue name. Queue names are case-insensitive and will always be forced to lowercase.
- name: queueName
value: "queuename"
# Time in seconds to wait before auto deleting idle subscriptions. Used during subscription creation only. Default: `0` (disabled) (Optional)
#- name: autoDeleteOnIdleInSec
# value: "0"
# Default message time to live, in seconds. Used during subscription creation only. (Optional)
#- name: defaultMessageTimeToLiveInSec
# value: "10"
# When set to true, queues and subscriptions do not get created automatically. Default: 'false' (Optional)
#- name: disableEntityManagement
# value: "false"
# Timeout for invoking the app's handler. Default: `0` (Optional)
#- name: handlerTimeoutInSec
# value: "0"
# Defines the length in seconds that a message will be locked for before expiring. Used during subscription creation only. Default set by server. (Optional)
#- name: lockDurationInSec
# value: "30"
# Defines the frequency at which buffered message locks will be renewed. (Optional)
#- name: lockRenewalInSec
# value: "20"
# Defines the maximum number of messages to be processing or in the buffer at once. This should be at least as big as the "maxConcurrentHandlers". (Optional)
#- name: maxActiveMessages
# value: "1"
# Defines the maximum number of concurrent message handlers; set to `0` for unlimited. Default: `1` (Optional)
#- name: maxConcurrentHandlers
# value: "1"
# Maximum interval (in seconds) to wait before attempting to reconnect to Azure Service Bus in case of a connection failure. After each attempt, the binding waits a random number of seconds, increasing every time, between the minimum and the maximum. Default is 300 seconds (5 minutes). (Optional)
#- name: maxConnectionRecoveryInSec
# value: "300"
# Defines the number of attempts the server will make to deliver a message. Used during subscription creation only. Default set by server. (Optional)
#- name: maxDeliveryCount
# value: "10"
# Maximum number of retriable errors that are processed per second. If a message fails to be processed with a retriable error, the component adds a delay before it starts processing another message, to avoid immediately re-processing messages that have failed (Optional)
#- name: maxRetriableErrorsPerSec
# value: "10"
# Minimum interval (in seconds) to wait before attempting to reconnect to Azure Service Bus in case of a connection failure. (Optional)
#- name: minConnectionRecoveryInSec
# value: "2"
# Time in milliseconds for the initial exponential backoff when Azure Service Bus throttle messages. Defaults: `500` (Optional)
#- name: publishInitialRetryIntervalInMs
# value: "500"
# The max number of retries for when Azure Service Bus responds with "too busy" in order to throttle messages. Defaults: `5` (Optional)
#- name: publishMaxRetries
# value: "5"
# Specifies a custom route for incoming events. (Optional)
#- name: route
# value: "/custom-path"
# Timeout for all invocations to the Azure Service Bus endpoint, in seconds. Note that this option impacts network calls and it's unrelated to the TTL applies to messages. (Optional)
#- name: timeoutInSec
# value: "60"
# Parameter to set the default message time to live. If this parameter is omitted, messages will expire after 14 days (the built-in default value in Azure Sevice Bus). (Optional)
#- name: ttlInSeconds
# value: "86400"

Binding information

Input Binding: yes

Output Binding: yes

Output Binding operations:

  • create: Publish a new message in the queue.

Authentication profiles

Available authentication profiles:

  • Connection string

  • Azure AD: Client credentials

  • Azure AD: Client certificate

Connection string

Authenticate using a connection string.

connectionString

Required - The Service Bus connection string. Used for input binding direction. Used for output binding direction.

Example value: Endpoint=sb://{ServiceBusNamespace}.servicebus.windows.net/;SharedAccessKeyName={PolicyName};SharedAccessKey={Key};EntityPath={ServiceBus}

Azure AD: Client credentials

Authenticate using Azure AD with client credentials, also known as "service principals".

azureClientId

Required - Client ID (application ID)

Example value: c7dd251f-811f-4ba2-a905-acd4d3f8f08b

azureClientSecret

Required - Client secret (application password)

Example value: Ecy3XG7zVZK3/vl/a2NSB+a1zXLa8RnMum/IgD0E

azureTenantId

Required - ID of the Azure AD tenant

Example value: cd4b2887-304c-47e1-b4d5-65447fdd542a

namespaceName

Required - Parameter to set the address of the Service Bus namespace, as a fully-qualified domain name. Used for input binding direction. Used for output binding direction.

Example value: namespace.servicebus.windows.net

azureEnvironment

Optional name for the Azure environment if using a different Azure cloud

Default value: AzurePublicCloud

Example value: AzurePublicCloud

Allowed values:

  • AzurePublicCloud

  • AzureChinaCloud

  • AzureUSGovernmentCloud

Azure AD: Client certificate

Authenticate using Azure AD with a client certificate. "azureCertificate" is required.

azureClientId

Required - Client ID (application ID)

Example value: c7dd251f-811f-4ba2-a905-acd4d3f8f08b

azureTenantId

Required - ID of the Azure AD tenant

Example value: cd4b2887-304c-47e1-b4d5-65447fdd542a

namespaceName

Required - Parameter to set the address of the Service Bus namespace, as a fully-qualified domain name. Used for input binding direction. Used for output binding direction.

Example value: namespace.servicebus.windows.net

azureCertificate

Certificate and private key (in either a PEM file containing both the certificate and key, or in PFX/PKCS#12 format)

Example value:

-----BEGIN PRIVATE KEY-----\n MIIEvgI... \n -----END PRIVATE KEY-----
\n -----BEGIN CERTIFICATE----- \n MIICoTC... \n -----END CERTIFICATE----- \n

azureCertificatePassword

Password for the certificate if encrypted.

Example value: password

azureEnvironment

Optional name for the Azure environment if using a different Azure cloud

Default value: AzurePublicCloud

Example value: AzurePublicCloud

Allowed values:

  • AzurePublicCloud

  • AzureChinaCloud

  • AzureUSGovernmentCloud

Metadata

direction (string)

Required - Indicates the direction of the binding component.

Example value: input,output

Allowed values:

  • input

  • output

  • input,output

Documentation: https://docs.dapr.io/reference/api/bindings_api/#binding-direction-optional

queueName (string)

Required - The Service Bus queue name. Queue names are case-insensitive and will always be forced to lowercase.

Example value: queuename

autoDeleteOnIdleInSec (number)

Time in seconds to wait before auto deleting idle subscriptions. Used during subscription creation only. Default: 0 (disabled)

Default value: 0

Example value: 3600

defaultMessageTimeToLiveInSec (number)

Default message time to live, in seconds. Used during subscription creation only.

Example value: 10

disableEntityManagement (bool)

When set to true, queues and subscriptions do not get created automatically. Default: 'false'

Default value: false

Example value: true

handlerTimeoutInSec (number)

Timeout for invoking the app's handler. Default: 0

Default value: 0

Example value: 30

lockDurationInSec (number)

Defines the length in seconds that a message will be locked for before expiring. Used during subscription creation only. Default set by server.

Example value: 30

lockRenewalInSec (number)

Defines the frequency at which buffered message locks will be renewed. Used for input binding direction.

Default value: 20

Example value: 20

maxActiveMessages (number)

Defines the maximum number of messages to be processing or in the buffer at once. This should be at least as big as the "maxConcurrentHandlers". Used for input binding direction.

Default value: 1

Example value: 8

maxConcurrentHandlers (number)

Defines the maximum number of concurrent message handlers; set to 0 for unlimited. Default: 1 Used for input binding direction.

Default value: 1

Example value: 10

maxConnectionRecoveryInSec (number)

Maximum interval (in seconds) to wait before attempting to reconnect to Azure Service Bus in case of a connection failure. After each attempt, the binding waits a random number of seconds, increasing every time, between the minimum and the maximum. Default is 300 seconds (5 minutes).

Default value: 300

Example value: 600

maxDeliveryCount (number)

Defines the number of attempts the server will make to deliver a message. Used during subscription creation only. Default set by server.

Example value: 10

maxRetriableErrorsPerSec (number)

Maximum number of retriable errors that are processed per second. If a message fails to be processed with a retriable error, the component adds a delay before it starts processing another message, to avoid immediately re-processing messages that have failed Used for input binding direction.

Default value: 10

Example value: 2

minConnectionRecoveryInSec (number)

Minimum interval (in seconds) to wait before attempting to reconnect to Azure Service Bus in case of a connection failure.

Default value: 2

Example value: 5

publishInitialRetryIntervalInMs (number)

Time in milliseconds for the initial exponential backoff when Azure Service Bus throttle messages. Defaults: 500 Used for output binding direction.

Default value: 500

Example value: 1000

publishMaxRetries (number)

The max number of retries for when Azure Service Bus responds with "too busy" in order to throttle messages. Defaults: 5 Used for output binding direction.

Default value: 5

Example value: 10

route (string)

Specifies a custom route for incoming events.

Example value: /custom-path

Documentation: https://docs.dapr.io/developing-applications/building-blocks/bindings/howto-triggers/#specify-a-custom-route

timeoutInSec (number)

Timeout for all invocations to the Azure Service Bus endpoint, in seconds. Note that this option impacts network calls and it's unrelated to the TTL applies to messages.

Default value: 60

Example value: 30

ttlInSeconds (number)

Parameter to set the default message time to live. If this parameter is omitted, messages will expire after 14 days (the built-in default value in Azure Sevice Bus). Used for output binding direction.

Example value: 86400