gpt4 book ai didi

azure-eventhub - 如何在 Eventhub 中实现过滤器?

转载 作者:行者123 更新时间:2023-12-02 01:02:31 26 4
gpt4 key购买 nike

在我的应用程序中,发布到 Eventhub 的各种事件。但是我的消费者群体只需要特定的一组事件。如何在 Eventhub 中过滤这个?

最佳答案

关注此 post :

event hubs doesn't support filtering as subscriptions on a topic for example and it's due to performance and thorughput reasons that need to be maximazed to have million events/sec for the ingestion system.



正如@Sapnandu 提到的,您可以为此使用 Azure 服务总线,或者您可以使用 Event Processor Host 自己实现过滤器

例如 - 当使用 node module 时EPH:
const onMessage = async (context, data) => {
// use data to get message payload (data.body) and implement a filter here
// suggestion: create an event name field for each message and query it here
};

const onError = (error) => {
// do something with it
};

await eph.start(onMessage, onError);

关于azure-eventhub - 如何在 Eventhub 中实现过滤器?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/49656956/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com