Azure Service Bus

关于 Azure Service Bus pubsub 组件的详细文档

配置

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.

  1. apiVersion: dapr.io/v1alpha1
  2. kind: Component
  3. metadata:
  4. name: servicebus-pubsub
  5. namespace: default
  6. spec:
  7. type: pubsub.azure.servicebus
  8. version: v1
  9. metadata:
  10. - name: connectionString # Required
  11. value: "Endpoint=sb://{ServiceBusNamespace}.servicebus.windows.net/;SharedAccessKeyName={PolicyName};SharedAccessKey={Key};EntityPath={ServiceBus}"
  12. - name: timeoutInSec # Optional
  13. value: 60
  14. - name: handlerTimeoutInSec # Optional
  15. value: 60
  16. - name: disableEntityManagement # Optional
  17. value: "false"
  18. - name: maxDeliveryCount # Optional
  19. value: 3
  20. - name: lockDurationInSec # Optional
  21. value: 60
  22. - name: lockRenewalInSec # Optional
  23. value: 20
  24. - name: maxActiveMessages # Optional
  25. value: 2000
  26. - name: maxActiveMessagesRecoveryInSec # Optional
  27. value: 2
  28. - name: maxConcurrentHandlers # Optional
  29. value: 10
  30. - name: prefetchCount # Optional
  31. value: 5
  32. - name: defaultMessageTimeToLiveInSec # Optional
  33. value: 10
  34. - name: autoDeleteOnIdleInSec # Optional
  35. value: 10
  36. - name: maxReconnectionAttempts # Optional
  37. value: 30
  38. - name: connectionRecoveryInSec # Optional
  39. value: 2
  40. - name: publishMaxRetries # Optional
  41. value: 5
  42. - name: publishInitialRetryInternalInMs # Optional
  43. value: 500

__注意:__上述设置在使用该组件的所有主题中是通用的。

Warning

以上示例将密钥明文存储, It is recommended to use a secret store for the secrets as described here.

元数据字段规范

字段必填详情Example
connectionStringYConnection-string for the Service BusEndpoint=sb://{ServiceBusNamespace}.servicebus.windows.net/;SharedAccessKeyName={PolicyName};SharedAccessKey={Key};EntityPath={ServiceBus}
timeoutInSecN发送消息和其他管理操作的超时时间。 默认值:6030
handlerTimeoutInSecN调用应用handler的超时。 # 可选的。 默认值:6030
disableEntityManagementN设置为 “true “时,主题和订阅不会自动创建。 默认值为 “false”“true”, “false”
maxDeliveryCountN定义服务器发送消息的尝试次数。 由服务端默认设置10
lockDurationInSecN定义消息过期前被锁定的时长,以秒为单位。 由服务端默认设置30
lockRenewalInSecN定义缓冲消息锁的更新频率。 默认值:20.20
maxActiveMessagesN定义一次要缓冲或处理的消息的最大数量。 默认值:100002000
maxActiveMessagesRecoveryInSecN定义达到最大活跃消息限制后等待的时长(秒) 默认值:2 默认值:210
maxConcurrentHandlersN定义并发消息处理器的最大数量10
prefetchCountN定义预取消息的数量(用于高吞吐量/低延迟场景)5
defaultMessageTimeToLiveInSecN默认消息存活时间10
autoDeleteOnIdleInSecN自动删除消息前等待的时间(秒)10
maxReconnectionAttemptsNDefines the maximum number of reconnect attempts. 默认值: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

创建Azure Service Bus

请按照此处的说明设置Azure Service Bus Topics。

相关链接