Is your feature request related to a problem? Please describe.
Assuming that the user code create a Connectionfactory instance, directly or using .NET Aspire, my code (library) need to check (to verify during worker startup) when user use DispatchConsumersAsync = false, but try to use a asynchronous consumer.
Describe the solution you'd like
RabbitMQ.Client.ConnectionConfig is created with a DispatchConsumersAsync boolean property copy during ConnectionFactory.CreateConnectionAsync() call.
ConnectionConfig is forward to both, AutorecoveringConnection or Connection, constructors.
But today IConnection does not have a property to expose this.
Possible Solution
On RabbitMQ.Client.IConnection Interface
bool DispatchConsumersAsync { get; }
On RabbitMQ.Client.Framing.Impl.AutorecoveringConnection Class
Throw an exception itself when call Channel.BasicConsume() method with a synchronous consumer when ConnectionFactory is set to work with asynchronous dispatch. And vice-versa.
Is your feature request related to a problem? Please describe.
Assuming that the user code create a
Connectionfactory
instance, directly or using .NET Aspire, my code (library) need to check (to verify during worker startup) when user useDispatchConsumersAsync = false
, but try to use a asynchronous consumer.Describe the solution you'd like
RabbitMQ.Client.ConnectionConfig
is created with aDispatchConsumersAsync
boolean property copy duringConnectionFactory.CreateConnectionAsync()
call.ConnectionConfig
is forward to both,AutorecoveringConnection
orConnection
, constructors.But today
IConnection
does not have a property to expose this.Possible Solution
On RabbitMQ.Client.IConnection Interface
On RabbitMQ.Client.Framing.Impl.AutorecoveringConnection Class
On RabbitMQ.Client.Framing.Impl.Connection Class
Describe alternatives you've considered
Throw an exception itself when call Channel.BasicConsume() method with a synchronous consumer when ConnectionFactory is set to work with asynchronous dispatch. And vice-versa.
Additional context
No response