rabbitmq-dotnet-client icon indicating copy to clipboard operation
rabbitmq-dotnet-client copied to clipboard

CallbackException not raised for AsyncEventingBasicConsumer

Open ashish-g-lahane opened this issue 3 years ago • 3 comments

RabbitMq_CallbackExceptionBug.zip

PFA the sample. When using AsyncEventingBasicConsumer, CallbackException event never fires. But when using EventingBasicConsumer (plz uncomment the code at the bottom of the Program.cs), it does.

I think the issue is in the class AsyncConsumerWorkService at line 93. The task is not awaited always. If the task finishes earlier or synchronously, then task.IsCompleted will be true resulting in never awaiting on the task.

"RabbitMQ.Client" Version="6.2.1"

ashish-g-lahane avatar Apr 21 '21 04:04 ashish-g-lahane

@ashish-g-lahane you are welcome to submit a PR (against master and the 6.x branch) with a test case. Thanks.

michaelklishin avatar Apr 21 '21 10:04 michaelklishin

@michaelklishin I have the same issue. Can I submit a PR to main and 6x branch?

@shikow of course. Thanks.

michaelklishin avatar Jul 09 '21 04:07 michaelklishin

@ashish-g-lahane thanks for providing code. I turned it into a test in PR #1585, which demonstrates that this issue will be fixed in version 7 of this library.

lukebakken avatar May 31 '24 21:05 lukebakken