-
Notifications
You must be signed in to change notification settings - Fork 595
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
RabbitMQActivitySource.Deliver cannot be used by types that implement Consumer #1621
Comments
I'll take a look :) |
@stebet thank you!!! |
Wouldn't it be better to move it inside of the dispatcher rather than the BasicConsumer? |
@bollhals would you mind expanding on your comment? I'm assuming that you mean
|
Yes exactly. I wondered whether it would make more sense to do it at that level than in the consumer themselves. |
looks reasonable to me. |
Yeah, I agree, this looks quite neat. |
Describe the bug
Currently
RabbitMQActivitySource.Deliver
is only called in the derived typesAsyncEventingBasicConsumer
andEventingBasicConsumer
and the method itself is marked as internal.rabbitmq-dotnet-client/projects/RabbitMQ.Client/client/events/AsyncEventingBasicConsumer.cs
Lines 99 to 105 in 89d472d
This means, if a dev is deriving from the base types
DefaultBasicConsumer
orAsyncDefaultBasicConsumer
or implements the appropriate interfaces, the Deliver method can't be invoked.All the other relevant ActivitySource methods are called from within ChannelBase, so these should be fine.
I think the easiest way forward is to make a public RabbitMQActivitySource.Deliver method with the args from the eventArgs:
Current:
rabbitmq-dotnet-client/projects/RabbitMQ.Client/client/impl/RabbitMQActivitySource.cs
Lines 122 to 142 in 89d472d
Proposed change:
Then the dev can call it in their own implementation of
HandleBasicDeliver
. I don't see any easy way to do it automatically, like for the other methods, that would be preferable.Reproduction steps
Expected behavior
Additional context
Maybe @stebet has a better idea, he wrote the original PR.
The text was updated successfully, but these errors were encountered: