Reading Azure Service Bus Queue

旧巷老猫 提交于 2019-11-29 16:55:24

Check out these videos from Scott Hanselman and Mark Simms on Azure Queues. It's C# but you get the idea.

https://channel9.msdn.com/Search?term=azure%20queues%20simms#ch9Search

Touches on:

  • Storage Queues vs. Service Bus Queues
  • Grabbing messages in bulk vs. one by one (chunky vs. chatty)
  • Dealing with poison messages (bad actors)
  • Misc implementation details
  • Much more stuff i can't remember now

As for your compute, you can either do a VM, a Worker Role (Cloud Services), App Service Webjobs, or Azure Functions.

The Webjobs SDK and Azure Functions bot have a way to subscribe to Queue events (notify on message).

(Listed from IaaS to PaaS to FaaS - Azure Functions - if such a thing exists).

Azure Functions already has sample code provided as templates to do all that with Node. Just make a new Function and follow the wizard.

If you need to touch data on-prem you either need to look at integrating with a VNET that has site-to-site connectivity back to your prem, or Hybrid Connections (App Service only!). Azure Functions can't do that yet, but every other compute is a go.

https://azure.microsoft.com/en-us/documentation/articles/web-sites-hybrid-connection-get-started/ (That tutorial is Windows only but you can pull data from any OS. The Hybrid Connection Manager has to live on a Windows box, but then it acts as a reverse proxy to any host on your network).

To deal with Azure ServiceBus Queue easily, the best option seems to be Azure Webjob.

There is a ServiceBusTrigger that allows you to get messages from an Azure ServiceBus queue.

For node.js integration, you should have a look at Azure Function. It is built on top of the webjob SDK and have node.js integration :

In the second article, there is an example on how get messages from a queue using Azure Function and nodejs :

module.exports = function(context, myQueueItem) {
    context.log('Node.js ServiceBus queue trigger function processed message', myQueueItem);
    context.done();
};
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!