Skip to content

Add Spring RabbitMQ plugin#796

Open
liuhaolong10 wants to merge 3 commits intoapache:mainfrom
liuhaolong10:spring_rabbit
Open

Add Spring RabbitMQ plugin#796
liuhaolong10 wants to merge 3 commits intoapache:mainfrom
liuhaolong10:spring_rabbit

Conversation

@liuhaolong10
Copy link

Fix RabbitMQ trace disconnection and incomplete consumer trace stack (closes #13720)

  • Add a unit test to verify that the fix works.
  • Explain briefly why the bug exists and how to fix it.

Bug Root Cause

The original instrumentation method in the RabbitMQ plugin is executed in a dedicated thread pool for RabbitMQ message processing, which is not the same thread where consumers execute business logic. This causes trace information loss:

  • The plugin can only capture "message consumed" events but cannot track subsequent business operations (e.g., MySQL/Redis calls).
  • The traceId cannot be connected between producer and consumer services.

Fix Solution

  1. Implement a new instrumentation method for RabbitMQ that aligns with the business logic thread, ensuring traceId continuity between producer and consumer.
  2. Modify the original RabbitMQ plugin code to avoid data collection conflicts with the new spring-rabbit plugin.

Additional Notes for New Plugin

The new spring-rabbit plugin solves the problem that the original RabbitMQ plugin cannot collect messages consumed by @RabbitListener annotation, ensuring complete trace collection for spring-rabbit based RabbitMQ consumption scenarios.

  • If this pull request closes/resolves/fixes an existing issue, replace the issue number. Closes #13720.
  • Update the CHANGES log.

@wu-sheng wu-sheng added enhancement New feature or request plugin labels Mar 8, 2026
@wu-sheng wu-sheng added this to the 9.7.0 milestone Mar 8, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request plugin

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants