how to use a di injected custom rabbitmq client #2448
-
the following scenario causes a rain of memory leaking rabbitmq connection exceptions
the use case calls for
please advise on the viability of the scenario and alternate non-memory leaking approaches that satisfy the dynamic rabbitmq connection constraint at minimum |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
I'm unfortunately not familiar enough with dependency injection and how it works with scoped services. I'm also not familiar enough with the RabbitMQ client library you're using to know whether it plays nicely with scoped services - for example, when does the connection get closed? I don't think this problem is necessarily specific to Durable Functions, but you might have better luck using a singleton connection factory and managing the lifetime of connections (e.g. connection pooling) yourself. |
Beta Was this translation helpful? Give feedback.
I'm unfortunately not familiar enough with dependency injection and how it works with scoped services. I'm also not familiar enough with the RabbitMQ client library you're using to know whether it plays nicely with scoped services - for example, when does the connection get closed?
I don't think this problem is necessarily specific to Durable Functions, but you might have better luck using a singleton connection factory and managing the lifetime of connections (e.g. connection pooling) yourself.