简体   繁体   English

使用 Azure 中的 IAsyncCollector 将消息从服务总线主题批量发送到另一个主题即使在收到消息后功能也会保持重试

[英]Send Messages from service bus topic to another as batches using IAsyncCollector in Azure Functions keeps retries even after message received

I have an azure function which receives messages from service bus topic and send to another using IAsyncCollector.我有一个 azure function,它从服务总线主题接收消息并使用 IAsyncCollector 发送到另一个。 Even after the message received in another topic it's not removed from the sender topic and keep retrying.Any idea why it is happening.即使在另一个主题中收到消息后,它也不会从发件人主题中删除并继续重试。知道为什么会这样。 Also would like to get some samples to use IAsyncCollector.还想获得一些使用 IAsyncCollector 的示例。 Or is there any other way in azure function I can send messages in batches?或者在azure function有没有其他方法可以批量发消息?

Often this would happen if messages are not completed when received.如果消息在收到时未完成,通常会发生这种情况。 By default, Azure Function would auto-complete messages if the code executes successfully.默认情况下,如果代码成功执行,Azure Function 将自动完成消息。 Check that you don't override the auto-completion by setting AutoComplete to false and that there is no exception during function execution after messages are forwarded to the destination with IAsyncCollection , as either of these two would cause the messages to be received and sent multiple times.检查您是否没有通过将AutoComplete设置为 false 来覆盖自动完成,并且在使用IAsyncCollection将消息转发到目的地后的 function 执行期间没有异常,因为这两者中的任何一个都会导致消息被多次接收和发送次。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM