OpenTracing RabbitMQ Client Instrumentation
OpenTracing instrumentation for RabbitMQ Client.
Installation
pom.xml
<dependency>
<groupId>io.opentracing.contrib</groupId>
<artifactId>opentracing-rabbitmq-client</artifactId>
<version>VERSION</version>
</dependency>
Usage
// Instantiate tracer
Tracer tracer = ...
// Optionally register tracer with GlobalTracer
GlobalTracer.register(tracer);
// Decorate RabbitMQ Channel with TracingChannel
TracingChannel tracingChannel = new TracingChannel(channel, tracer);
// Send
tracingChannel.basicPublish(...);
// Get
GetResponse response = tracingChannel.basicGet(queueName, false);
// Consume
tracingChannel.basicConsume(...);
// Factory
ConnectionFactory factory = new TracingConnectionFactory(tracer);
Connection connection = factory.newConnection();