[QUERY] Manipulate Prefetch for better processing
See original GitHub issueLibrary name and version
Try migrate Microsoft.Azure.WebJobs.Extensions.ServiceBus 4.2.2
to Microsoft.Azure.WebJobs.Extensions.ServiceBus 5.2.0
Query/Question
Hi
I created some feature that was based on MessageReceiver from Microsoft.Azure.WebJobs.Extensions.ServiceBus 4.2.2
That was manipulated a Prefetch
to better fit the amount of getting the message
so process as big as possible batches but including the condition of application
e.g.:
- scale batch size between 1-X messages by attribute (to prevent throttling of knowing functions)
- scale down if a batch of messages is too slow processed (and future prefetched messages may be expired before it is even started)
- scale up if processing work fast
- scale to 1 when start receiving dependant service errors (and append delay to get next message)
Now when try to take ServiceBusReceiver from Microsoft.Azure.WebJobs.Extensions.ServiceBus 5.2.0
I can’t change ServiceBusReceiver
Prefetch or even get it
(previously I use IBinding
and took “MessageReceiver” from context.BindingData, but now all of them return ServiceBusMessageActions
)
Could you tell me is there any possible way to change Prefetch in runtime? Or do you have any plan to make it?
Environment
.NET SDK Version: 6.0.100 Commit: 9e8b04bbff
Runtime environment: OS Name: Windows OS Version: 10.0.19044 OS Platform: Windows RID: win10-x64
Host (useful for support): Version: 6.0.0 Commit: 4822e3c3aa
IDE: Visual Studio 2022 (v. 17.0.2)
Issue Analytics
- State:
- Created 2 years ago
- Comments:12 (6 by maintainers)
Top GitHub Comments
Hi
It looks like
5.8.1
version ofMicrosoft.Azure.WebJobs.Extensions.ServiceBus
solved all my needsSo I can use
IBinding
to take aMessageReceiver
and then use reflection to change Prefetch and it will be applied when the last batch will be consumed, what is good enoughThanks, for me you can close a ticket
I don’t think this issue is specific to the extensions, as when using the SDK directly you are not able to modify the Prefetch count for a running receiver.
We haven’t heard of this request before - we can take it into consideration.