<bdo id='nfSOq'></bdo><ul id='nfSOq'></ul>

    <i id='nfSOq'><tr id='nfSOq'><dt id='nfSOq'><q id='nfSOq'><span id='nfSOq'><b id='nfSOq'><form id='nfSOq'><ins id='nfSOq'></ins><ul id='nfSOq'></ul><sub id='nfSOq'></sub></form><legend id='nfSOq'></legend><bdo id='nfSOq'><pre id='nfSOq'><center id='nfSOq'></center></pre></bdo></b><th id='nfSOq'></th></span></q></dt></tr></i><div id='nfSOq'><tfoot id='nfSOq'></tfoot><dl id='nfSOq'><fieldset id='nfSOq'></fieldset></dl></div>

      <small id='nfSOq'></small><noframes id='nfSOq'>

      <legend id='nfSOq'><style id='nfSOq'><dir id='nfSOq'><q id='nfSOq'></q></dir></style></legend>

      <tfoot id='nfSOq'></tfoot>
    1. Azure Function V2 服务总线消息延迟

      时间:2023-10-05

              <tbody id='5Ltqi'></tbody>
          • <tfoot id='5Ltqi'></tfoot>

              <legend id='5Ltqi'><style id='5Ltqi'><dir id='5Ltqi'><q id='5Ltqi'></q></dir></style></legend>

              <small id='5Ltqi'></small><noframes id='5Ltqi'>

              • <bdo id='5Ltqi'></bdo><ul id='5Ltqi'></ul>
              • <i id='5Ltqi'><tr id='5Ltqi'><dt id='5Ltqi'><q id='5Ltqi'><span id='5Ltqi'><b id='5Ltqi'><form id='5Ltqi'><ins id='5Ltqi'></ins><ul id='5Ltqi'></ul><sub id='5Ltqi'></sub></form><legend id='5Ltqi'></legend><bdo id='5Ltqi'><pre id='5Ltqi'><center id='5Ltqi'></center></pre></bdo></b><th id='5Ltqi'></th></span></q></dt></tr></i><div id='5Ltqi'><tfoot id='5Ltqi'></tfoot><dl id='5Ltqi'><fieldset id='5Ltqi'></fieldset></dl></div>
              • 本文介绍了Azure Function V2 服务总线消息延迟的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                问题描述

                我正在尝试将我的 v1 函数转换为 v2 函数,但我找不到延迟消息的替代方法.

                I am attempting to convert my v1 function to a v2 function, but I cannot find a replacement for deferring a message.

                在 Azure Functions V1 中,它是 BrokeredMesage 上的一个方法,称为 .DeferAsync().在 V2 中不再有 BrokeredMessage 而是只有一个 Microsoft.Azure.ServiceBus.Message 并且不包含 .DeferAsync().

                In V1 of Azure Functions it was a method on the BrokeredMesage called .DeferAsync(). In V2 there is no longer a BrokeredMessage but just a Microsoft.Azure.ServiceBus.Message and this does not contain the method of .DeferAsync().

                根据 docs:

                API 在 .NET Framework 客户端中为 BrokeredMessage.Defer 或 BrokeredMessage.DeferAsync,在 .NET Standard 客户端中为 MessageReceiver.DeferAsync,在 Java 客户端中为 messageReceiver.defer 或 messageReceiver.deferSync.

                The API is BrokeredMessage.Defer or BrokeredMessage.DeferAsync in the .NET Framework client, MessageReceiver.DeferAsync in the .NET Standard client, and mesageReceiver.defer or messageReceiver.deferSync in the Java client.

                但是我怎样才能访问 MessageReciever?这是我的函数的一个示例:

                But how can I get access to the MessageReciever? Here is an example of my function:

                [FunctionName("MyFunction")]
                public static void Run([ServiceBusTrigger("topic", "subscription", Connection = "AzureServiceBusPrimary")]Message message, ILogger log)
                {
                    //Code
                }
                

                那么有谁知道如何推迟从 Azure 服务总线触发的 V2 Message?

                So does anyone know how to defer a V2 Message that is triggered from the Azure Service Bus?

                推荐答案

                正如您所提到的,新的消息接收器提供了一个异步延迟方法,您可以使用以下代码将其添加到您的函数中:

                As you mention, the new message receiver offers an async defer method and you can add this to your function by using the following code:

                [FunctionName("MyFunction")]
                public static async Task Run([ServiceBusTrigger("topic", "subscription", Connection = "AzureServiceBusPrimary")]Message message, string lockToken, MessageReceiver messageReceiver, ILogger log)
                {
                    //Your function logic
                    await messageReceiver.DeferAsync(lockToken);
                }
                

                这篇关于Azure Function V2 服务总线消息延迟的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                上一篇:Azure 函数 blob 绑定 下一篇:从 azure 函数调用 web api 的最佳方法

                相关文章

                <small id='uiVbe'></small><noframes id='uiVbe'>

                  <i id='uiVbe'><tr id='uiVbe'><dt id='uiVbe'><q id='uiVbe'><span id='uiVbe'><b id='uiVbe'><form id='uiVbe'><ins id='uiVbe'></ins><ul id='uiVbe'></ul><sub id='uiVbe'></sub></form><legend id='uiVbe'></legend><bdo id='uiVbe'><pre id='uiVbe'><center id='uiVbe'></center></pre></bdo></b><th id='uiVbe'></th></span></q></dt></tr></i><div id='uiVbe'><tfoot id='uiVbe'></tfoot><dl id='uiVbe'><fieldset id='uiVbe'></fieldset></dl></div>
                1. <tfoot id='uiVbe'></tfoot>

                2. <legend id='uiVbe'><style id='uiVbe'><dir id='uiVbe'><q id='uiVbe'></q></dir></style></legend>
                  • <bdo id='uiVbe'></bdo><ul id='uiVbe'></ul>