Selecting Partition of Azure event hub when using rest api

后端 未结 1 686
无人共我
无人共我 2021-01-13 20:43

I\'m trying to send messages to Azure Event Hub using python and the rest API after some failed experiments i have found working code (see below) but i want to be able to se

相关标签:
1条回答
  • 2021-01-13 21:28

    Following the section 'Send Event' of Event Hubs REST APIs docunment https://msdn.microsoft.com/en-us/library/azure/dn790664.aspx, you can't use the Request URI https://{serviceNamespace}.servicebus.windows.net/{eventHubPath}/messages to select to which partition to send events.

    You should use the Request URI https://{serviceNamespace}.servicebus.windows.net/{eventHubPath}/publishers/{deviceId}/messages. The attribute {deviceId} is partition key what used to group/partition devices—whether it is geo-location, device type, version, tenant, and so on.

    But the partition count must be a number between 2 and 32. So if you need to use more than 32 partitions, I suggest to put the key into the event data.

    Best Regards.

    0 讨论(0)
提交回复
热议问题