0
votes

I am developing a queue triggered azure function. Also I am very new to it. Following is the configuration of my "function.json" file:

{
  "disabled": false,
  "bindings": [
    {
      "name": "myQueueItem",
      "type": "queueTrigger",
      "direction": "in",
      "queueName": "testqueue-1",
      "connection": "MyQueueTriggeredConnectionString"
    }
  ]
}

My function is working fine. It is triggered for all entries in "testqueue-1" queue.

now I have few questions:

  1. Can I give multiple queue name in "queueName" parameter?

  2. Can I give some naming pattern in "queueName" paramener. Like we can give pattern in "path" parameter in blob triggered function: "path": "input/{name1}~123~{name2}"

  3. If I do 10 entries in my queue. Will all entries execute simultaneously? or one by one? If it is simultaneously, How can I make it one by one?

Also if possible. please share some useful links that can help me to understand queue triggered azure in better way.

Thanks,

1
Please be a bit more specific, since this is a very broad post. Also, I believe most of your questions are relatively easy to search for or find on github. Refer to How to Ask. - rickvdbosch
@rickvdbosch Thanks for showing interest to help me. My specific question is : Can I bind my single queue triggered azure function to multiple queues? if Yes the how? - Yash
By default: no you cannot. You can, however, have multiple functions in the same class all trigger on different queuenames, but call the same logic to handle the messages. - rickvdbosch
I wonder why you would want an azure function to be triggered by multiple queues. Can you elaborate? - Peter Bons
@PeterBons, I have separate queue for each of my customers. But I want to execute one common logic on all queues. That is why I want a queue triggered function that can handle multiple queues - Yash

1 Answers

3
votes

Although the question is not super elaborate I will try to answer what I think you want to know;

Can I give multiple queue name in "queueName" parameter? No. And it really doesn't seem to make a lot of sense to have for example two queues trigger the same function. Why not just define a parameter on your queue message to define the client? For example a jSON? Otherwise you will have to be creating queues for each client. What a nightmare.

Can I give some naming pattern in "queueName" parameter. Like we can give pattern in "path" parameter in blob triggered function: "path": "input/{name1}~123~{name2}" No. Once again that's not what queue binding is for. Pass parameters on the message.

If I do 10 entries in my queue. Will all entries execute simultaneously? or one by one? If it is simultaneously, How can I make it one by one? You can define this on your host.json file. Check the documentation here: https://docs.microsoft.com/en-us/azure/azure-functions/functions-host-json

If you want to make it one by one you can define singleton or, although still not fully supported, set WEBSITE_MAX_DYNAMIC_APPLICATION_SCALE_OUT to 1 in you application settings.