use of com.alibaba.rocketmq.client.producer.SendStatus in project incubator-skywalking by apache.
the class OnSuccessInterceptor method beforeMethod.
@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");
activeSpan.setComponent(ComponentsDefine.ROCKET_MQ);
SendStatus sendStatus = ((SendResult) allArguments[0]).getSendStatus();
if (sendStatus != SendStatus.SEND_OK) {
activeSpan.errorOccurred();
Tags.STATUS_CODE.set(activeSpan, sendStatus.name());
}
ContextManager.continued(enhanceInfo.getContextSnapshot());
}
Aggregations