Search in sources :

Example 26 with ActiveMQTextMessage

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();
}
Also used : ActiveMQTextMessage(org.apache.activemq.command.ActiveMQTextMessage) Test(org.junit.Test)

Example 27 with ActiveMQTextMessage

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();
}
Also used : ActiveMQTextMessage(org.apache.activemq.command.ActiveMQTextMessage) Test(org.junit.Test)

Example 28 with ActiveMQTextMessage

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();
}
Also used : ActiveMQTextMessage(org.apache.activemq.command.ActiveMQTextMessage) Test(org.junit.Test)

Example 29 with ActiveMQTextMessage

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();
}
Also used : ActiveMQTextMessage(org.apache.activemq.command.ActiveMQTextMessage) Test(org.junit.Test)

Example 30 with ActiveMQTextMessage

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);
}
Also used : MutableSpan(brave.handler.MutableSpan) ActiveMQTextMessage(org.apache.activemq.command.ActiveMQTextMessage) Test(org.junit.Test)

Aggregations

ActiveMQTextMessage (org.apache.activemq.command.ActiveMQTextMessage)71 Test (org.junit.Test)36 TextMessage (javax.jms.TextMessage)16 ActiveMQQueue (org.apache.activemq.command.ActiveMQQueue)14 Message (javax.jms.Message)10 MessageProducer (javax.jms.MessageProducer)10 MessageConsumer (javax.jms.MessageConsumer)9 MessageId (org.apache.activemq.command.MessageId)9 JMSException (javax.jms.JMSException)7 ActiveMQBytesMessage (org.apache.activemq.command.ActiveMQBytesMessage)7 DestinationStatistics (org.apache.activemq.broker.region.DestinationStatistics)6 MessageReference (org.apache.activemq.broker.region.MessageReference)6 Queue (org.apache.activemq.broker.region.Queue)6 ActiveMQMapMessage (org.apache.activemq.command.ActiveMQMapMessage)6 ActiveMQObjectMessage (org.apache.activemq.command.ActiveMQObjectMessage)6 ActiveMQStreamMessage (org.apache.activemq.command.ActiveMQStreamMessage)6 ConsumerInfo (org.apache.activemq.command.ConsumerInfo)6 SystemUsage (org.apache.activemq.usage.SystemUsage)6 MutableSpan (brave.handler.MutableSpan)5 MessageNotWriteableException (javax.jms.MessageNotWriteableException)5