question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Support triggering a single function on multiple queues (wildcard queue name)

See original GitHub issue

Example scenario: A webjob that monitors all *-poison queues in a storage account, with a single generic action taken on all (e.g. write queue message to blob for inspection, email/Slack/SMS to ops team to alert of failure).

I’ve looked into implementing this as an extension, but rapidly ended up with 90% of the code being duplication of the core SDK due to much of the infrastructure behind QueueTriggerAttribute being marked as internal.

Would you be willing to consider a pull request that creates a MultipleQueueTriggerAttribute that accepts a regex to match against queue names, creates a listener monitoring all matching queues and adds a queueName binding in addition to the existing bindings?

public static void HandlePoisonQueues(
    [MultipleQueueTriggerAttribute(".*-poison")] string message,
    string queueName,
    [Blob("poison/{queueName}/{id}.txt")] TextWriter blob,
    TextWriter logger)
{
    logger.WriteLine($"Poison message received on {queueName}")
    blob.Write(message);
}

Issue Analytics

  • State:open
  • Created 7 years ago
  • Reactions:31
  • Comments:15

github_iconTop GitHub Comments

6reactions
cocowallacommented, Jan 4, 2020

Has anyone from Microsoft had a look at this, and is it on the backlog?

For massive scale and better tenancy isolation, 1 queue per tenant would be ideal - but that would also require one function binding per queue too, which is far from ideal (and likely to hit some scaling limitation, which are rife throughout all Azure services)

5reactions
dotnetnatecommented, Jul 5, 2021

Bueller? At 5 years and ticking, this would be nice to have.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Is it possible to create a queue triggered azure function ...
By default: no you cannot. You can, however, have multiple functions in the same class all trigger on different queuenames, but call the...
Read more >
Two different Service Bus queue trigger function apps with ...
Hi, I have two service bus queue triggers function apps with same service bus name and queue details, but pointing to different destinations....
Read more >
Chapter 4. Addresses, Queues, and Topics Red Hat AMQ 7.4
A queue is associated with an address. There can be multiple queues per address. Once an incoming message is matched to an address,...
Read more >
Azure Queue storage trigger for Azure Functions
Use the queue trigger to start a function when a new item is received on a queue. The queue message is provided as...
Read more >
Part 4: RabbitMQ Exchanges, routing keys and bindings
An exchange is responsible for routing the messages to different queues with the help of header attributes, bindings, and routing keys.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found