Warning: file_get_contents(/data/phpspider/zhask/data//catemap/6/eclipse/9.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Azure 如何确保消息在队列中持续10分钟_Azure_Azure Functions_Azureservicebus - Fatal编程技术网

Azure 如何确保消息在队列中持续10分钟

Azure 如何确保消息在队列中持续10分钟,azure,azure-functions,azureservicebus,Azure,Azure Functions,Azureservicebus,我有两个应用程序App1控制台应用程序和App2 Azure func应用程序 App1用于注册新客户 App2用于为新客户激活帐户 我们需要确保App1发送的每条消息在App2使用该消息之前在队列中存储10分钟 从App1中,我获取客户id、客户名称等输入,并将此消息发送到队列。 使用简单代码- // Create a new message to send to the queue string messageBody = $"Message {i}"

我有两个应用程序App1控制台应用程序和App2 Azure func应用程序

App1用于注册新客户 App2用于为新客户激活帐户

我们需要确保App1发送的每条消息在App2使用该消息之前在队列中存储10分钟

从App1中,我获取客户id、客户名称等输入,并将此消息发送到队列。 使用简单代码-

// Create a new message to send to the queue
                    string messageBody = $"Message {i}";
                    var message = new Message(Encoding.UTF8.GetBytes(messageBody));

                    // Write the body of the message to the console
                    Console.WriteLine($"Sending message: {messageBody}");

                    // Send the message to the queue
                    await queueClient.SendAsync(message);
我是否需要为10分钟场景添加任何设置

在App2中,我需要阅读此消息,但需要在App2使用此消息之前确保10分钟。 如何做到这一点,以确保消息在队列中有10分钟

当我搜索stackoverflow时,我找到了这个 如果添加了5分钟超时的消息,则只会在该消息超时后进行处理。
这意味着在发送消息时,我需要设置一些内容?

它看起来像是您正在寻找的内容

您可以将消息提交到队列或主题以进行延迟处理;例如,安排作业在某个时间可供系统处理。此功能实现了可靠的分布式基于时间的调度器

在定义的排队时间之前,计划消息不会在队列中具体化。在此之前,可以取消预定的邮件。取消删除消息

您可以通过设置通过常规发送路径发送消息时的属性来安排消息,也可以使用API显式地安排消息。后者立即返回计划消息的SequenceNumber,如果需要,您可以稍后使用它取消计划消息。还可以使用查找计划消息及其序列号


是的,我正在使用azure function应用程序等待,但我不确定如何等待10分钟才能阅读?我发现,如果一条消息添加了5分钟的超时,那么它只会在这之后被处理。在给定的重复答案中?我应该怎么做?如果我理解正确,消息应该隐藏10分钟,然后才能被任何客户端使用。我说得对吗?