Azure Event Hubs 绑定规范

关于 Azure Event Hubs 组件绑定的详细文档

配置

要开始 Azure 事件中心绑定,需要创建一个类型为 bindings.azure.eventhubs 的组件。 See this guide on how to create and apply a binding configuration.

参考此实例来创建一个事件中心。

  1. apiVersion: dapr.io/v1alpha1
  2. kind: Component
  3. metadata:
  4. name: <NAME>
  5. namespace: <NAMESPACE>
  6. spec:
  7. type: bindings.azure.eventhubs
  8. version: v1
  9. metadata:
  10. - name: connectionString # Azure EventHubs connection string
  11. value: "Endpoint=sb://****"
  12. - name: consumerGroup # EventHubs consumer group
  13. value: "group1"
  14. - name: storageAccountName # Azure Storage Account Name
  15. value: "accountName"
  16. - name: storageAccountKey # Azure Storage Account Key
  17. value: "accountKey"
  18. - name: storageContainerName # Azure Storage Container Name
  19. value: "containerName"
  20. - name: partitionID # (Optional) PartitionID to send and receive events
  21. value: 0

Warning

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

元数据字段规范

字段必填绑定支持详情Example
connectionStringY输出EventHubs 连接字符串。 请注意,这是 EventHubs 本身,而不是 EventHubs 名称空间。 确保使用子 EventHub 共享访问策略连接字符串“Endpoint=sb://**
consumerGroupY输出The name of an EventHubs Consumer Group to listen on“group1”
storageAccountNameY输出The name of the account of the Azure Storage account to persist checkpoints data on“accountName”
storageAccountKeyY输出The account key for the Azure Storage account to persist checkpoints data on“accountKey”
storageContainerNameY输出The name of the container in the Azure Storage account to persist checkpoints data on“contianerName”
partitionIDN输出ID of the partition to send and receive events0

绑定支持

字段名为 ttlInSeconds

  • create

相关链接