Skip to content

opentracing-contrib/java-rabbitmq-client

Repository files navigation

Build Status Coverage Status Released Version Apache-2.0 license

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();

License

Apache 2.0 License.