EventHub 在本地触发 FunctionApp - 消息存储在哪里?

EventHub Triggered FunctionApp Locally - Where are messages stored?

当我开发带有本地触发的事件中心的 Azure Function 应用程序时,一些有线的东西引起了我的注意。当我开始调试时,我的消费者功能应用偶尔会通过事件中心使用我之前的消息自动触发,但是,当时我什至没有触发我的事件中心发布者!感觉就像一些事件消息存储在一些我不知道它们在哪里的缓存位置,它们也试图一次又一次地从后台触发我的功能应用程序......

我的应用程序功能设置使用 UseDevelopmentStorage=true,与我的任何存储帐户无关,此外,上述情况并非每次都会发生,但这让我很担心,因为我没有为什么同一条消息被多次触发是我无法控制的,一旦消息被函数应用程序发布和使用,它应该从事件中心消息队列中消失,对吧?

谁能告诉我在哪里可以查看本地存储的消息或在 Azure 门户中发布的消息?非常感谢!

Can anyone please let me know where I can check my messaged stored locally or when published in Azure portal?

首先,恐怕 azure 函数不会将您的消息保存到 official document 上的 cache.Based 中:

When all function execution completes (with or without errors), checkpoints are added to the associated storage account. When check-pointing succeeds, all 1,000 messages are never retrieved again.

以上是事件中心检查点的描述mechanism.Besides,您可以参考这个blogAzureWebJobsStorage在本地调试函数时设置为UseDevelopmentStorage=true,所以我建议你检查本地存储中的数据account.When你运行它在门户,关联存储帐户将被检查。

这里有一些类似的问题供大家参考:

1.https://github.com/Azure/azure-functions-host/issues/2796

2.https://github.com/Azure/Azure-Functions/issues/589

3.https://github.com/Azure/azure-event-hubs-dotnet/issues/358

当然,您可以打开堆栈here以获得更多帮助。