use of com.rabbitmq.client.impl.AMQChannel in project pinpoint by naver.
the class RabbitMQConsumerHandleCompleteInboundCommandInterceptor method before.
@Override
public void before(Object target, Object[] args) {
if (!validate(target, args)) {
return;
}
AMQCommand command = (AMQCommand) args[0];
Method method = command.getMethod();
if (!(method instanceof AMQP.Basic.GetOk)) {
return;
}
if (isDebug) {
logger.beforeInterceptor(target, args);
}
try {
AMQChannel channel = (AMQChannel) target;
final Trace trace = createTrace(channel, command);
if (trace == null) {
return;
}
if (!trace.canSampled()) {
return;
}
SpanEventRecorder recorder = trace.traceBlockBegin();
recorder.recordServiceType(RabbitMQClientConstants.RABBITMQ_CLIENT_INTERNAL);
} catch (Throwable th) {
if (logger.isWarnEnabled()) {
logger.warn("BEFORE. Caused:{}", th.getMessage(), th);
}
}
}
use of com.rabbitmq.client.impl.AMQChannel in project pinpoint by pinpoint-apm.
the class RabbitMQConsumerHandleCompleteInboundCommandInterceptor method before.
@Override
public void before(Object target, Object[] args) {
if (!validate(target, args)) {
return;
}
AMQCommand command = (AMQCommand) args[0];
Method method = command.getMethod();
if (!(method instanceof AMQP.Basic.GetOk)) {
return;
}
if (isDebug) {
logger.beforeInterceptor(target, args);
}
try {
AMQChannel channel = (AMQChannel) target;
final Trace trace = createTrace(channel, command);
if (trace == null) {
return;
}
if (!trace.canSampled()) {
return;
}
SpanEventRecorder recorder = trace.traceBlockBegin();
recorder.recordServiceType(RabbitMQClientConstants.RABBITMQ_CLIENT_INTERNAL);
} catch (Throwable th) {
if (logger.isWarnEnabled()) {
logger.warn("BEFORE. Caused:{}", th.getMessage(), th);
}
}
}
Aggregations