Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -252,9 +252,6 @@ void testRocketmqProduceAndConsume() throws Exception {

@Test
void testRocketmqProduceAndBatchConsume() throws Exception {
// context propagation doesn't work for batch messages in 5.3.4
Assumptions.assumeFalse(Boolean.getBoolean("testLatestDeps"));

consumer.setConsumeMessageBatchMaxSize(2);
// This test assumes that messages are sent and received as a batch. Occasionally it happens
// that the messages are not received as a batch, but one by one. This doesn't match what the
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,14 @@ public void onSuccess(ReceiveMessageResult receiveMessageResult) {
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.

// links to the individual producer spans through context propagation
for (MessageView messageView : messageViews) {
VirtualFieldStore.setContextByMessage(messageView, context);
// Extract context from individual message properties (trace headers)
Context messageContext = RocketMqSingletons.propagators()
.getTextMapPropagator()
.extract(context, messageView, MessageMapGetter.INSTANCE);
VirtualFieldStore.setContextByMessage(messageView, messageContext);
}
}
}
Expand Down
Loading