OpenTracing instrumentation for RabbitMQ Client.
pom.xml
<dependency>
<groupId>io.opentracing.contrib</groupId>
<artifactId>opentracing-rabbitmq-client</artifactId>
<version>VERSION</version>
</dependency>
// 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();