You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 6727767
Browse filesBrowse the repository at this point in the historyBrowse files
Fix the RocketMQ async-send callback NPE, and the client-java plugin with newer clients (#848)
* rocketMQ-5.x: skip callbacks without SendCallBackEnhanceInfo in OnSuccessInterceptor.
Since rocketmq-client 5.1.4 the producer wraps every async-send callback in
BackpressureSendCallBack, and the wrapped callback threw an NPE and stopped the
wrapper's span, whose afterMethod then threw a second NPE (apache/skywalking#14189).
* rocketMQ-client-java-5.x: intercept every PushConsumerImpl constructor taking the
ClientConfiguration and the MessageListener, so push-consumer spans get their peer
and mq.broker again with rocketmq-client-java 5.0.8 or later.
* rocketMQ-client-java-5.x: stop rebuilding the sent message, which dropped the lite
topic and the priority. Inject the span into the producer's PublishingMessageImpl
copy and add the headers to the properties it sends.
* Test rocketmq-client 5.5, and rocketmq-client-java 5.0, 5.1 and 5.2.
Copy file name to clipboardExpand all lines: apm-sniffer/apm-sdk-plugin/rocketMQ-5.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/rocketMQ/v5/OnSuccessInterceptor.java
+14Lines changed: 14 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -34,6 +34,11 @@
34
34
/**
35
35
* {@link OnSuccessInterceptor} create local span when the method {@link org.apache.rocketmq.client.producer.SendCallback#onSuccess(SendResult)}
36
36
* execute.
37
+
* <p>
38
+
* {@link MessageSendInterceptor} attaches the {@link SendCallBackEnhanceInfo} to the callback passed to {@link
39
+
* org.apache.rocketmq.client.impl.MQClientAPIImpl}. A callback invoked by that callback, such as the user callback that
40
+
* {@code DefaultMQProducerImpl$BackpressureSendCallBack} wraps since rocketmq-client 5.1.4, usually has none. It runs
41
+
* inside the span of the outer callback, so all three methods skip it, which keeps the span stack balanced.
Copy file name to clipboardExpand all lines: apm-sniffer/apm-sdk-plugin/rocketMQ-client-java-5.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/rocketMQ/client/java/v5/MessageSendAsyncInterceptor.java
Copy file name to clipboardExpand all lines: apm-sniffer/apm-sdk-plugin/rocketMQ-client-java-5.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/rocketMQ/client/java/v5/MessageSendInterceptor.java
Copy file name to clipboardExpand all lines: apm-sniffer/apm-sdk-plugin/rocketMQ-client-java-5.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/rocketMQ/client/java/v5/PushConsumerImplInterceptor.java
0 commit comments