use of org.eclipse.paho.client.mqttv3.internal.wire.MqttPublish in project pinpoint by naver.
the class MqttV3CallbackMessageArrivedInterceptor method recordDataByVersion.
@Override
protected void recordDataByVersion(Object target, SpanRecorder recorder, Object[] args) {
MqttPublish mqttPublish = ArrayArgumentUtils.getArgument(args, 0, MqttPublish.class);
if (mqttPublish != null) {
recorder.recordRpcName(buildRpcName(mqttPublish.getTopicName(), mqttPublish.getMessage().getQos()));
MqttMessage mqttMessage = mqttPublish.getMessage();
String payload = BytesUtils.toString(mqttMessage.getPayload());
recorder.recordAttribute(MQTT_MESSAGE_PAYLOAD_ANNOTATION_KEY, payload);
String endPoint = getEndPoint(target);
recorder.recordEndPoint(endPoint);
}
}
Aggregations