use of brave.handler.MutableSpan in project brave by openzipkin.
the class ITJms_1_1_TracingMessageConsumer method receive_resumesTrace.
void receive_resumesTrace(JMSRunnable send, MessageConsumer messageConsumer) throws JMSException {
TraceContext parent = resetB3PropertyWithNewSampledContext(jms);
send.run();
Message received = messageConsumer.receive();
MutableSpan consumerSpan = testSpanHandler.takeRemoteSpan(CONSUMER);
assertChildOf(consumerSpan, parent);
assertThat(received.getStringProperty("b3")).isEqualTo(parent.traceIdString() + "-" + consumerSpan.id() + "-1");
}
use of brave.handler.MutableSpan in project brave by openzipkin.
the class ITJms_1_1_TracingMessageConsumer method messageListener_runsAfterConsumer.
void messageListener_runsAfterConsumer(JMSRunnable send, MessageConsumer messageConsumer) throws JMSException {
messageConsumer.setMessageListener(m -> {
});
send.run();
MutableSpan consumerSpan = testSpanHandler.takeRemoteSpan(CONSUMER);
MutableSpan listenerSpan = testSpanHandler.takeLocalSpan();
assertChildOf(listenerSpan, consumerSpan);
assertSequential(consumerSpan, listenerSpan);
}
use of brave.handler.MutableSpan in project brave by openzipkin.
the class ITTracingJMSConsumer method messageListener_readsBaggage.
void messageListener_readsBaggage(Runnable send) {
consumer.setMessageListener(m -> Tags.BAGGAGE_FIELD.tag(BAGGAGE_FIELD, tracing.tracer().currentSpan()));
String baggage = "joey";
producer.setProperty(BAGGAGE_FIELD_KEY, baggage);
send.run();
MutableSpan consumerSpan = testSpanHandler.takeRemoteSpan(CONSUMER);
MutableSpan listenerSpan = testSpanHandler.takeLocalSpan();
assertThat(consumerSpan.parentId()).isNull();
assertChildOf(listenerSpan, consumerSpan);
assertThat(listenerSpan.tags()).containsEntry(BAGGAGE_FIELD.name(), baggage);
}
use of brave.handler.MutableSpan in project brave by openzipkin.
the class ITTracingJMSConsumer method receive_startsNewTrace.
void receive_startsNewTrace(Runnable send) {
send.run();
consumer.receive();
MutableSpan consumerSpan = testSpanHandler.takeRemoteSpan(CONSUMER);
assertThat(consumerSpan.name()).isEqualTo("receive");
assertThat(consumerSpan.tags()).containsEntry("jms.queue", jms.queueName);
}
use of brave.handler.MutableSpan in project brave by openzipkin.
the class ITTracingJMSConsumer method messageListener_runsAfterConsumer.
@Test
public void messageListener_runsAfterConsumer() {
consumer.setMessageListener(m -> {
});
producer.send(jms.queue, "foo");
MutableSpan consumerSpan = testSpanHandler.takeRemoteSpan(CONSUMER);
MutableSpan listenerSpan = testSpanHandler.takeLocalSpan();
assertChildOf(listenerSpan, consumerSpan);
assertSequential(consumerSpan, listenerSpan);
}
Aggregations