wu-sheng commented on a change in pull request #5412:
URL: https://github.com/apache/skywalking/pull/5412#discussion_r479659635



##########
File path: 
apm-sniffer/apm-sdk-plugin/rocketMQ-4.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/rocketMQ/v4/OnExceptionInterceptor.java
##########
@@ -34,15 +34,22 @@
 public class OnExceptionInterceptor implements 
InstanceMethodsAroundInterceptor {
 
     public static final String CALLBACK_OPERATION_NAME_PREFIX = "RocketMQ/";
+    private static final String DEFAULT_TOPIC = "no_topic";
 
     @Override
     public void beforeMethod(EnhancedInstance objInst, Method method, Object[] 
allArguments, Class<?>[] argumentsTypes,
         MethodInterceptResult result) throws Throwable {
         SendCallBackEnhanceInfo enhanceInfo = (SendCallBackEnhanceInfo) 
objInst.getSkyWalkingDynamicField();
-        AbstractSpan activeSpan = 
ContextManager.createLocalSpan(CALLBACK_OPERATION_NAME_PREFIX + 
enhanceInfo.getTopicId() + "/Producer/Callback");
+        String topicId = DEFAULT_TOPIC;
+        if (enhanceInfo != null) {

Review comment:
       ```suggestion
           // The SendCallBackEnhanceInfo could be null when there is an 
internal exception in the client API,
           // such as MQClientException("no route info of this topic")
           if (enhanceInfo != null) {
   ```




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to