Azure / azure-functions-dotnet-worker

Azure Functions out-of-process .NET language worker
MIT License
414 stars 181 forks source link

Different batchSize per QueueTrigger (& other customised triggers) #382

Open brazierdavid opened 3 years ago

brazierdavid commented 3 years ago

Can do this in the WebJobs SDK:

https://stackoverflow.com/questions/52629666/azure-webjobs-queue-triggers-with-different-batch-sizes

But I can't see any equivalent of IQueueProcessorFactory in the Worker code - how would we achieve this?

fabiocav commented 3 years ago

This would require a custom extension that loads the IQueueProcessorFactory, and currently, for the isolated worker, we unfortunately don't have a lot of guidance for that.

Leaving this open and flagging as a documentation issue, but we don't have an ETA at this point.

plamber commented 3 years ago

Hi @fabiocav, we are also interested in finding out how to manipulate these settings.

We have queues that have different values in:

In 3.1 we manipulate these values using a custom IQueueProcessorFactory. Just adding it as a singleton in the .net worker does help.

Any point to the right direction is appreciated.

Thank you

onionhammer commented 3 years ago

Yeah storage queue batching would be amazing.

marklagendijk commented 3 years ago

You can still configure these settings globally by setting them in host.json. Most of you probably already knew that, I'm just putting it here for people who didn't know this yet (like me 1 hour back).

cleferman commented 2 years ago

Would also be interested in having a setting per queue basis to avoid creating multiple function apps. I would also settle for some docs on how to customize the processor ourselves.

lopezbertoni commented 2 years ago

Hi, got here and surprisingly I answered the SO question 😃 . Any updates on this for .NET 5/6 using the isolated worker hosting model? Currently running on .NET 3.1 but we want to upgrade and this would be needed for that matter. Configuring via code or host.json would be nice.

axeh commented 2 years ago

Any progress regarding this?

brazierdavid commented 2 years ago

It doesn't look like it will be addressed in the isolated worker model, so we're planning to revert to the "classic" in-process function app model when we migrate to .NET 6. To be honest, we only started using the isolated model because it seemed to be the strategic way forward when .NET 5 came out, but now that .NET 6 supports the in-process model with all the configurability over batch sizes etc, there is no need to keep trying.

SeanFeldman commented 2 years ago

@brazierdavid you might want to give it a second thought given the Functions roadmap

image
brazierdavid commented 2 years ago

@SeanFeldman ah thanks, I don't think I had seen that. Hopefully by the time they get to .NET 7 or 8 the isolated model will be feature-complete compared to in-process!

Farukh-Shaikh commented 1 year ago

Any update on this thread? I am looking to customize queue batchSize and maxDequeueCount for a specific queue trigger function only. is there any way in which I can achieve that

wouter-b commented 6 months ago

We've just moved to the isolated functions model, this functionality along with Singleton is still missing. Sadly for us this was a huge step backwards (while expecting to move forwards).

JosefBackovsky commented 1 month ago

Hello, is there anything new regarding this issue? Generally, the inability to set parameters for individual triggers is a complication. When we need different behavior, we have no choice but to create separate Azure functions, which is unnecessarily complicated.