问题标签 [azure-queues]

For questions regarding programming in ECMAScript (JavaScript/JS) and its various dialects/implementations (excluding ActionScript). Note JavaScript is NOT the same as Java! Please include all relevant tags on your question; e.g., [node.js], [jquery], [json], [reactjs], [angular], [ember.js], [vue.js], [typescript], [svelte], etc.

0 投票
2 回答
70 浏览

azure - Azure:同步卸载内存密集型任务?

我正在设计一个托管在 Azure 中的 ASP.NET Web 应用程序。我计划调整用户在服务器端上传的图像大小。我有一个库可以做到这一点,但目前这发生在主要的 Web 前端 VM 中。我想将此卸载到工作虚拟机。我了解使用队列执行此操作的模式,但我不想在任务完成之前返回给用户,因为我计划在处理请求完成后显示调整大小的图像。那么,如何卸载将同步执行的任务?(这意味着在远程任务完成之前我不会从呼叫站点返回。)

谢谢...

-本

0 投票
1 回答
364 浏览

.net - Microsoft Servicebus 无法创建 QueueClient

我正在尝试QueueClient为我的 Azure ServiceBus 队列创建一个。

var client = MessagingFactory.CreateQueueClient("testqueue");

我正在使用断点访问此代码,但是在此之后,什么也没有发生。也不例外,但代码中也没有下一步......

我在另一个应用程序中使用它,所以我认为它可能必须对某种程序集版本做一些事情,但这不应该抛出异常吗?我很困惑...

编辑:

“No client”或“Yes client”也不会写入控制台。另外,也不例外?!:

var client = MessagingFactory.CreateQueueClient("testqueue"); if(client == null) { Console.WriteLine("No client"); } else { Console.WriteLine("Yes client"); }

0 投票
3 回答
1408 浏览

azure - Azure 存储队列 - CloudQueueMessage 不同类型

我在 Azure 存储中有一个队列,我希望能够将不同的消息类型添加到队列中并将它们解析为它们的特定类型。

例如。

我可以将它们序列化为 JSON 并将它们添加到队列中,但是如何在不知道消息类型的情况下将它们反序列化为它们的特定类型?

我怎么知道下一条消息是客户还是员工?我可以在消息中添加某种属性说:“这是客户”或“这是员工”...

因为我有一个工作角色,它将在队列中查找消息并根据类型执行特定操作

0 投票
1 回答
244 浏览

nservicebus - 使用带有 NServiceBus 的 Azure 队列时,Bus.Send 被阻塞

我正在使用 Azure Queue 后端测试 NServiceBus。我使用所有默认设置配置了 NServiceBus,并使用此代码发送消息:

在我的开发机器上运行时,将消息发送到队列大约需要 700 毫秒。队列很远,直接使用 Azure 存储客户端写入时约为 350 毫秒。

现在我有两个问题:

  1. 我不希望线程阻塞 Bus.Send 调用。一种选择是使用 async\await 模式。另一种选择是使用内存队列来传递消息,类似于 0MQ。最后一个选项不能保证交付当然,但假设有一些监控功能,我可以接受。
  2. 为什么发送消息需要两倍于简单写入队列的时间?这可以优化吗?
0 投票
1 回答
1401 浏览

azure - 如何通过 JavaScript 访问 Azure 存储队列

出于测试目的,我们希望直接使用 JavaScript 访问 Azure 存储队列,而不是准备新的 Web 服务。

这可能吗?我们应该怎么做才能做到这一点,因为我找不到 Azure 存储的 JavaScript API 的官方文档。

0 投票
1 回答
1368 浏览

c# - C# 使用 Azure 和 Fire&Forget 发送电子邮件或 SMS 异步

我正在寻找一种简单的方法来触发和忘记 Twilio SMS 或电子邮件,我认为 Azure Queue 或 Bus 正是这样做的。但后来我开始阅读每一个,似乎它们是为了做一些更复杂的事情而设计的。

问题:
实现“Fire&Forget”方法/调用的最佳方式是什么,以便我知道我发送了一封电子邮件,但我的应用程序不需要停止等待消息实际离开。

0 投票
1 回答
329 浏览

php - Windows Azure PHP 队列 REST 代理限制

我正在编写一个作业处理器,以使用 Azure PHP SDK 从 Windows Azure 队列存储中出列。该作业只是尝试批量获取 32 条消息,处理它们,然后从队列中删除消息,并重复这些步骤。但是,每次我运行 PHP 脚本时,循环运行 27 次后都会抛出以下错误:

任何 Azure 专家都可以帮助我吗?

0 投票
1 回答
133 浏览

php - Azure Queue Behaving Unexpectedly

I have a PHP based application that uses Azure Queues. My application has one cron that runs on my web server every 20 minutes and it adds up to 2000 messages to Azure Queue storage. It used to put those messages in a single queue but now I use two different queues alternatively putting message in each one. There is also a sleeping period of one tenth of a second after every message is added to Queue to avoid throttling.

I have about 40 VMs on Azure that read from this Queue, process each message and then update the database if any of these messages trigger certain event. It happens once in 100 messages.

These VMs have a single PHP script that has a maximum run time of 900 seconds (set_time_limit(900)) and they run as cron jobs every 15 minutes (900 seconds).

The problem is that every half an hour (sometimes every hour) the VMs won't be able to read anything from the Queue for a few minutes. The message will be empty.

This is the code that I use

The result is simply an empty message. I have the following code to trace error

It prints and empty array. Exactly this is in my error log

Since the code works most of the time, I can't see what is the issue. Here is how I know that it happens regularly http://i.imgur.com/RE9XtVS.png

Y axis is the number of messages. X axis is time. The message count is taken every minute.

The flat curve after every alternate run of the script that adds message shows the problem. If the code had an issue the behavior won't be so erratic. I can't put my finger on what is wrong or where the problem could be. The code is pretty straight forward and it works most of the time other than those 5-10 minutes of non-activity.

I will appreciate any help on this. Thank you.

0 投票
3 回答
7020 浏览

c# - Azure WebJobs QueueTrigger 未触发

我试图找出应该从 Azure 存储队列触发的 Azure WebJobs QueueTrigger 方法我做错了什么。

我已经阅读了一些文档(如博客文章/msdn 文章)。但我仍然不清楚。

主要问题/被误解的方面:

Azure 存储控制台应用 App.config 或 Windows Azure 配置(门户)的连接字符串的名称应该是什么。到目前为止,我在两个地方都设置了以下名称。

  • Azure作业存储
  • AzureWebJobsStorage
  • AzureJobsRuntime
  • AzureJobsDashboard
  • AzureJobsData

这是我的 WebJobs 控制台应用程序代码。

这个控制台应用程序在我的 Azure 网站上持续运行。

我可以访问它的“调试”页面,我可以在其中切换输出,我看到它已启动/运行。

我添加队列的代码(来自我的 ASP.NET MVC 应用程序):

执行此代码,并将队列添加到我的存储帐户。但他们没有得到“出队”或从 WebJobs 中读取。

0 投票
1 回答
7660 浏览

azure - Azure 队列查看所有消息

我了解 Azure 队列不是严格的 FIFO。
而 Visual Studio Server Explorer 仅显示 32 条消息。我有大约 88 条消息在队列中。
是否可以在不取消队列的情况下查看 Azure 队列中的所有消息?