rabbit in spring boot project, the one total trace will divide two trace
Please answer these questions before submitting your issue.
- Why do you submit this issue?
- [ ] Question or discussion
- [x] Bug
- [ ] Requirement
- [ ] Feature or performance improvement
Bug
- Which version of SkyWalking, OS and JRE? 6.1
- Which company or project?
use rabbit
@RabbitListenerin spring project, the code like this:
@RabbitListener(queues = "aaaa")
public void handlerMessage(String message) {
// there will invoke dubbo service
}
It should be one trace like: rabbitmq-producer -> rabbitmq-consumer -> dubbo
but in fact, I got two trace: rabbitmq-producer -> rabbitmq-consumer and dubbo

I have find the reason:
the rabbit producer InstanceMethodsInterceptPoint was com.rabbitmq.client.impl.ChannelN#basicPublish , it will call at AMQP Connection Thread, But @RabbitListener method will call at other thread, So the trace will divide two trace
If set InstanceMethodsInterceptPoint is org.springframework.amqp.rabbit.listener.AbstractMessageListenerContainer#actualInvokeListener will solve this. But it was only support rabbit in spring boot not native rabbit.
So what do you think ? @wu-sheng
Then we need another instrumentation to make the across threads work.
what do you think about make a spring rabbit plugin as a optional plugin?
Optional plugin means
- The plugin is only required in particular cases
Or
- The plugin has performance concerns.
From the thing you post, look like this is a common spring for spring-rabbitmq-plugin. SkyWalking plugin is auto active, which means, when you don't active org.springframework.amqp.rabbit.listener.AbstractMessageListenerContainer#actualInvokeListener in your codes, it should stay cold.
No update in more than one month. Closing.
is this feature still need to be contributed? I think it can be implemented by adding intercept points in spring-amqp interfaces since spring-rabbit is an implementation for that.
is this feature still need to be contributed? I think it can be implemented by adding intercept points in
spring-amqpinterfaces sincespring-rabbitis an implementation for that.
Contribution is welcome, you could read the plugin dev doc, the last part is about what are required to contribute a plugin or enhance a plugin.
I make a spring-rabbit-plugin demo and test it. Now the trace looks like
A calling to rabbitmq generates 2 branches, one by spring-rabbit-plugin, another by rabbitmq-plugin. Any way to disable the original rabbit plugin when enable spring-rabbit plugin?
Remove the plugin jar from thr folder.