问题
In Azure worker roles, you can create a batch job that processes a list of messages. I'm wondering if there is something similar to that for Azure WebJobs?
Currently you can trigger a webjob from a queue as follows:
public static void ProcessQueueMessage([QueueTrigger("queue")] string message, TextWriter log)
Is there some way to pull and process a list of messages?
回答1:
No, there is no inbuilt binding for a batch of Queue messages currently.
However, someone in the community has recently created such a binding using the WebJobs SDK extensibility model. I have not used that binding yet, but you might give it a try and provide feedback to the author. See the GroupQueueTrigger repo and more information. It allows you to bind to a List<T>
of messages.
来源:https://stackoverflow.com/questions/35001148/how-to-get-an-azure-webjob-to-process-multiple-queue-messages