I have an Azure Functions QueueTrigger that listens on a storage queue for messages like this:
Message text
--------------------------
{"ClientName": "client1"}
{"ClientName": "client2"}
{"ClientName": "client3"}
The QueueTrigger then has code like this:
if 'client1' == queue_msg['ClientName']:
# do work required for client1
elif 'client2' == queue_msg['ClientName']:
# do work required for client2
elif 'client3' == queue_msg['ClientName']:
# do work required for client3
I'm using the Linux Consumption Plan with a batchSize
of 1
because each invocation of the queue trigger can take about 5 minutes and I want to make sure I don't exceed memory limitations. This solution is working well for me now, but I'm concerned that when the amount of clients increases, messages will start to accumulate in the queue. Is it okay to just create a new Azure Function that also listens on the same storage queue? I think it would be okay because each message/client has work that is independent to them so it wouldn't matter if either of the Azure Function apps picked up a message first. This seems like the most cost effective solution for me, but I would like to know if there are better alternatives or any negative outcomes that I'm not thinking of.