use of org.apache.activemq.command.ActiveMQTextMessage in project brave by openzipkin.
the class TracingMessageListenerTest method tags_consumer_span_but_not_listener.
@Test
public void tags_consumer_span_but_not_listener() {
ActiveMQTextMessage message = new ActiveMQTextMessage();
message.setDestination(createDestination("foo", QUEUE_TYPE));
onMessageConsumed(message);
assertThat(testSpanHandler.takeRemoteSpan(CONSUMER).tags()).containsEntry("jms.queue", "foo");
assertThat(testSpanHandler.takeLocalSpan().tags()).isEmpty();
}
use of org.apache.activemq.command.ActiveMQTextMessage in project brave by openzipkin.
the class TracingMessageListenerTest method listener_has_no_tags_when_header_present.
@Test
public void listener_has_no_tags_when_header_present() {
tracingMessageListener = new TracingMessageListener(delegate, jmsTracing, false);
ActiveMQTextMessage message = new ActiveMQTextMessage();
setStringProperty(message, "b3", B3SingleFormat.writeB3SingleFormatWithoutParentId(parent));
message.setDestination(createDestination("foo", QUEUE_TYPE));
onMessageConsumed(message);
assertThat(testSpanHandler.takeLocalSpan().tags()).isEmpty();
}
use of org.apache.activemq.command.ActiveMQTextMessage in project brave by openzipkin.
the class TracingMessageListenerTest method listener_completes.
@Test
public void listener_completes() {
tracingMessageListener = new TracingMessageListener(delegate, jmsTracing, false);
ActiveMQTextMessage message = new ActiveMQTextMessage();
onMessageConsumed(message);
// implicitly checked
testSpanHandler.takeLocalSpan();
}
use of org.apache.activemq.command.ActiveMQTextMessage in project brave by openzipkin.
the class TracingMessageListenerTest method listener_has_no_remote_service_name.
@Test
public void listener_has_no_remote_service_name() {
tracingMessageListener = new TracingMessageListener(delegate, jmsTracing, false);
ActiveMQTextMessage message = new ActiveMQTextMessage();
onMessageConsumed(message);
testSpanHandler.takeLocalSpan();
}
use of org.apache.activemq.command.ActiveMQTextMessage in project brave by openzipkin.
the class TracingMessageListenerTest method continues_parent_trace_single_header.
@Test
public void continues_parent_trace_single_header() {
ActiveMQTextMessage message = new ActiveMQTextMessage();
setStringProperty(message, "b3", B3SingleFormat.writeB3SingleFormatWithoutParentId(parent));
onMessageConsumed(message);
// clearing headers ensures later work doesn't try to use the old parent
assertNoProperties(message);
MutableSpan consumerSpan = testSpanHandler.takeRemoteSpan(CONSUMER);
MutableSpan listenerSpan = testSpanHandler.takeLocalSpan();
assertChildOf(consumerSpan, parent);
assertChildOf(listenerSpan, consumerSpan);
}
Aggregations