Search in sources :

Example 66 with ActiveMQTextMessage

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

Example 67 with ActiveMQTextMessage

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

Example 68 with ActiveMQTextMessage

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

Example 69 with ActiveMQTextMessage

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

Example 70 with ActiveMQTextMessage

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);
}
Also used : 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