azure - 超过允许的接收器最大数量。连接到 IoT Hub 的 Azure 流分析作业

标签 azure azure-iot-hub azure-eventhub azure-stream-analytics

我有一个 Azure 流分析 (ASA) 作业,用于将事件从我的 IoT 中心路由到一些函数应用和 Blob 存储。最近,当我在 ASA 作业中选择 Iot Hub 时,我在输入预览中收到以下错误:

Encountered error when communicating with EventHub: Exceeded the maximum number of allowed receivers per partition in a consumer group which is 5. List of connected receivers - [List of uids]

我最初认为这是由于 ASA 中的输出太多,因为我有 6 个,但我将其减少到 5 个,但仍然出现错误。然后,经过一些研究,问题似乎出在物联网中心/事件中心一侧,有太多接收者试图访问同一消费者组。我从 here 得到这个假设:

EventHubReceiverQuotaExceeded Cause: Stream Analytics can't connect to a partition because the maximum number of allowed receivers per partition in a consumer group has been reached. Recommendation: Ensure that other Stream Analytics jobs or Service Bus Explorer are not using the same consumer group.

因此,我检查了我的 Azure 资源以确保确定,但我没有任何其他 ASA 作业,也没有任何服务 Bus Explorer 资源。我还进入 Iot Hub 并专门为我的 ASA 作业创建了一个新的消费者组,然后更改了我的 ASA 作业以使用该消费者组。

运气不好,我仍然收到错误。

对于可能导致此问题的原因有什么想法吗?

作为引用,这是我的 ASA 职位查询:

SELECT
    *
INTO
    storage
FROM
    iothub

SELECT
    *
INTO
    d2cMessages
FROM
    iothub

SELECT
    *
INTO
    storageQueueFunction
FROM
    iothub
WHERE
    recType LIKE '3'
    
SELECT
    *
INTO
    heartbeatD2CFunctionApp
FROM
    iothub
WHERE
    recType LIKE '51'

SELECT
    *
INTO
    ackC2D
FROM
    iothub
WHERE
    recType LIKE '54'

最佳答案

您的作业中有多个查询,它们都从 IoT 中心输入读取。来自 docs :

If your streaming query syntax references the same input Event Hub resource multiple times, the job engine can use multiple readers per query from that same consumer group. When there are too many references to the same consumer group, the job can exceed the limit of five and thrown an error.

一个简单的解决方法是创建一个临时结果集,如下所示:

WITH telemetry AS (
   SELECT * FROM iotHub
)

然后您可以将查询更改为从遥测读取。

SELECT
    *
INTO
    storageQueueFunction
FROM
    telemetry 
WHERE
    recType LIKE '3'

解决问题的另一种方法是为事件中心创建多个输入,每个输入都有不同的使用者组。

关于azure - 超过允许的接收器最大数量。连接到 IoT Hub 的 Azure 流分析作业,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/74305395/

相关文章:

azure - 事件中心的可扩展性

azure - 找不到类型或命名空间 EventProcessorClient

r - 在 Azure ML Studio 中转置和添加 R 中的列

.net - Windows Azure 跟踪日志不工作

c# - 向 Azure 物联网中心发送消息

Azure 物联网中心 - TLS 连接和 x.509 身份验证

node.js - X509_check_private_key :key values mismatch error: DPS , 物联网集线器

python - ValueError : Cannot serialize: <myproject. storage.AzureStorage 对象位于 0x7f85185e66d0>

Azure Function 不会在 Push-OutputBinding 中使用 Stop ErrorAction 引发终止错误

azure - 如何决定在 Azure 事件中心中使用多少个分区