Skip to content

Conversation

@Arunodoy18
Copy link

Context propagation was not working correctly for batch messages in RocketMQ 5.0+ because all messages in a batch were sharing the same receive span context instead of each message having its own context extracted from message properties.

Changes:

  • Modified ReceiveSpanFinishingCallback to extract individual context for each message in the batch using MessageMapGetter to read trace headers
  • Each message now gets its own properly linked context for correct tracing
  • Re-enabled testRocketmqProduceAndBatchConsume test for latest dependencies

This fixes the issue where batch message consumers would not properly propagate trace context from producers, breaking distributed tracing for RocketMQ batch message processing in versions 5.3.4+.

Resolves the disabled test from #15512

Context propagation was not working correctly for batch messages in RocketMQ 5.0+
because all messages in a batch were sharing the same receive span context instead
of each message having its own context extracted from message properties.

Changes:
- Modified ReceiveSpanFinishingCallback to extract individual context for each
  message in the batch using MessageMapGetter to read trace headers
- Each message now gets its own properly linked context for correct tracing
- Re-enabled testRocketmqProduceAndBatchConsume test for latest dependencies

This fixes the issue where batch message consumers would not properly propagate
trace context from producers, breaking distributed tracing for RocketMQ batch
message processing in versions 5.3.4+.

Resolves the disabled test from open-telemetry#15512
@Arunodoy18 Arunodoy18 requested a review from a team as a code owner December 6, 2025 16:46
@trask
Copy link
Member

trask commented Dec 6, 2025

Moving to draft, please move back to ready to review once the tests are passing.

@trask trask marked this pull request as draft December 6, 2025 20:28
@Arunodoy18 Arunodoy18 marked this pull request as ready for review December 7, 2025 07:31
null,
timer.startTime(),
timer.now());
// For batch messages, each message should have its own context that properly
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As pointed out in #15523 (comment) this won't work.

@laurit laurit added the needs author feedback Waiting for additional feedback from the author label Dec 7, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

needs author feedback Waiting for additional feedback from the author

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants