多个 Azure EventHub 触发器到 Azure Function 应用中的单个函数 [英] Multiple Azure EventHub trigger to single function in Azure Function app
问题描述
我想从两个不同的 eventthub 中执行相同的功能(根据消息数据进行少量更改).
I want to do the same functionality (with few changes based on message data) from two different eventhubs.
是否可以将两个消费者组附加到一个函数.
Is it possible to attach two consumer group to a single function.
即使我将它添加到 function.json,它也不起作用.
It did not work even though I add it to function.json.
推荐答案
简短的回答是否定的.您不能将多个输入触发器绑定到同一个函数:https://github.com/Azure/azure-webjobs-sdk-script/wiki/function.json
The short answer is no. You cannot bind multiple input triggers to the same function: https://github.com/Azure/azure-webjobs-sdk-script/wiki/function.json
一个函数只能有一个触发器绑定,并且可以有多个输入/输出绑定.
A function can only have a single trigger binding, and can have multiple input/output bindings.
但是,您可以通过将共享代码包装在辅助方法中或使用 预编译函数.
However, you can call the same "shared" code from multiple functions by either wrapping the shared code in a helper method, or using Precompiled Functions.
这篇关于多个 Azure EventHub 触发器到 Azure Function 应用中的单个函数的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!