'How are ServiceBusReceivers managed by ServiceBusTriggers

Following the best practices for reuse of Service Bus factories and clients, the reuse of ServiceBusReceiver is recommended. This great answer for another question shows how a factory with such receivers can be implemented, which is then meant to be used as a singleton. However, I can't seem to find details of how this can be used together with a ServiceBusTrigger. Can this be done?

I guess my question stems from a limited understanding of how the ServiceBusTrigger is actually triggered, and how the different parameters of a trigger can be bound. I.e. does the trigger somehow create and use ServiceBusReceiver under the hood? Any additional insight into this area is greatly appreciated!

Using the in-process worker for .Net 6, for a project with multiple ServiceBusTriggers



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source