use of brave.Tracer.SpanInScope in project brave by openzipkin.
the class TracingMessageProducer method publish.
@Override
public void publish(Topic topic, Message message, int deliveryMode, int priority, long timeToLive) throws JMSException {
checkTopicPublisher();
TopicPublisher tp = (TopicPublisher) delegate;
Span span = createAndStartProducerSpan(message, destination(message));
SpanInScope ws = tracer.withSpanInScope(span);
Throwable error = null;
try {
tp.publish(topic, message, deliveryMode, priority, timeToLive);
} catch (Throwable t) {
propagateIfFatal(t);
error = t;
throw t;
} finally {
if (error != null)
span.error(error);
span.finish();
ws.close();
}
}
use of brave.Tracer.SpanInScope in project brave by openzipkin.
the class TracingMessageProducer method publish.
@Override
public void publish(Message message, int deliveryMode, int priority, long timeToLive) throws JMSException {
checkTopicPublisher();
TopicPublisher tp = (TopicPublisher) delegate;
Span span = createAndStartProducerSpan(message, destination(message));
SpanInScope ws = tracer.withSpanInScope(span);
Throwable error = null;
try {
tp.publish(message, deliveryMode, priority, timeToLive);
} catch (Throwable t) {
propagateIfFatal(t);
error = t;
throw t;
} finally {
if (error != null)
span.error(error);
span.finish();
ws.close();
}
}
use of brave.Tracer.SpanInScope in project brave by openzipkin.
the class TracingMessageProducer method send.
@Override
public void send(Queue queue, Message message, int deliveryMode, int priority, long timeToLive) throws JMSException {
checkQueueSender();
QueueSender qs = (QueueSender) delegate;
Span span = createAndStartProducerSpan(message, destination(message));
SpanInScope ws = tracer.withSpanInScope(span);
Throwable error = null;
try {
qs.send(queue, message, deliveryMode, priority, timeToLive);
} catch (Throwable t) {
propagateIfFatal(t);
error = t;
throw t;
} finally {
if (error != null)
span.error(error);
span.finish();
ws.close();
}
}
use of brave.Tracer.SpanInScope in project brave by openzipkin.
the class TracingMessageProducer method send.
/* @Override JMS 2.0 method: Intentionally no override to ensure JMS 1.1 works! */
@JMS2_0
public void send(Destination destination, Message message, CompletionListener completionListener) throws JMSException {
Span span = createAndStartProducerSpan(message, destination);
completionListener = TracingCompletionListener.create(completionListener, destination, span, current);
SpanInScope ws = tracer.withSpanInScope(span);
Throwable error = null;
try {
delegate.send(destination, message, completionListener);
} catch (Throwable t) {
propagateIfFatal(t);
error = t;
throw t;
} finally {
if (error != null)
span.error(error).finish();
ws.close();
}
}
use of brave.Tracer.SpanInScope in project brave by openzipkin.
the class TracingMessageProducer method send.
@Override
public void send(Message message) throws JMSException {
Span span = createAndStartProducerSpan(message, destination(message));
SpanInScope ws = tracer.withSpanInScope(span);
Throwable error = null;
try {
delegate.send(message);
} catch (Throwable t) {
propagateIfFatal(t);
error = t;
throw t;
} finally {
if (error != null)
span.error(error);
span.finish();
ws.close();
}
}
Aggregations