use of org.apache.activemq.command.ActiveMQTextMessage in project brave by openzipkin.
the class TracingMessageListenerTest method listener_has_name.
@Test
public void listener_has_name() {
tracingMessageListener = new TracingMessageListener(delegate, jmsTracing, false);
ActiveMQTextMessage message = new ActiveMQTextMessage();
onMessageConsumed(message);
assertThat(testSpanHandler.takeLocalSpan().name()).isEqualTo("on-message");
}
use of org.apache.activemq.command.ActiveMQTextMessage in project brave by openzipkin.
the class TracingMessageListenerTest method listener_continues_parent_trace.
@Test
public void listener_continues_parent_trace() {
tracingMessageListener = new TracingMessageListener(delegate, jmsTracing, false);
ActiveMQTextMessage message = new ActiveMQTextMessage();
B3Propagation.B3_STRING.injector(SETTER).inject(parent, message);
onMessageConsumed(message);
// clearing headers ensures later work doesn't try to use the old parent
assertNoProperties(message);
assertChildOf(testSpanHandler.takeLocalSpan(), parent);
}
use of org.apache.activemq.command.ActiveMQTextMessage in project brave by openzipkin.
the class TracingMessageListenerTest method continues_parent_trace.
@Test
public void continues_parent_trace() {
ActiveMQTextMessage message = new ActiveMQTextMessage();
B3Propagation.B3_STRING.injector(SETTER).inject(parent, message);
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);
}
use of org.apache.activemq.command.ActiveMQTextMessage in project brave by openzipkin.
the class PropertyFilterTest method newMessageWithAllTypes.
static TextMessage newMessageWithAllTypes() throws JMSException {
TextMessage message = new ActiveMQTextMessage();
setAllPropertyTypes(message);
return message;
}
use of org.apache.activemq.command.ActiveMQTextMessage in project brave by openzipkin.
the class TracingJMSConsumerTest method receive_retains_baggage_properties.
@Test
public void receive_retains_baggage_properties() throws Exception {
ActiveMQTextMessage message = new ActiveMQTextMessage();
B3Propagation.B3_STRING.injector(SETTER).inject(parent, message);
message.setStringProperty(BAGGAGE_FIELD_KEY, "");
receive(message);
assertThat(message.getProperties()).containsEntry(BAGGAGE_FIELD_KEY, "");
testSpanHandler.takeRemoteSpan(CONSUMER);
}
Aggregations