opentracing-contrib / java-spring-cloud

Distributed tracing for Spring Boot, Cloud and other Spring projects
Apache License 2.0
390 stars 143 forks source link

Can't send JMS messages, getting 'uber-trace-id' is not a valid java identifier. #234

Open alextrs opened 5 years ago

alextrs commented 5 years ago

Using spring-integration and after added the opentracing starter:

        <dependency>
            <groupId>io.opentracing.contrib</groupId>
            <artifactId>opentracing-spring-jaeger-cloud-starter</artifactId>
            <version>1.0.3</version>
        </dependency>
        <dependency>
            <groupId>io.opentracing.contrib</groupId>
            <artifactId>opentracing-spring-cloud-starter</artifactId>
            <version>0.2.4</version>
        </dependency>

started to get errors:

javax.jms.JMSRuntimeException: AMQ139012: The property name 'uber-trace-id' is not a valid java identifier.
    at org.apache.activemq.artemis.jms.client.ActiveMQMessage.checkProperty(ActiveMQMessage.java:992) ~[artemis-jms-client-2.6.4.jar:2.6.4]
    at org.apache.activemq.artemis.jms.client.ActiveMQMessage.setObjectProperty(ActiveMQMessage.java:763) ~[artemis-jms-client-2.6.4.jar:2.6.4]
...

Accordingly to this (see at the bottom) all dashes should be replaced with $dash$ but this is not happening. When I try to use raw opentracing java-jms it works as expected

I created repo that can be used to reproduce this issue

pavolloffay commented 5 years ago

Could you please try 0.2.6 version?

If the java-jms works we are probably using a wrong version? Are you interested in submitting a fix for this?

alextrs commented 5 years ago

I tried 0.2.6 and also the latest version, but still getting the same error

        <dependency>
            <groupId>io.opentracing.contrib</groupId>
            <artifactId>opentracing-spring-jaeger-cloud-starter</artifactId>
            <version>2.0.0</version>
        </dependency>
        <dependency>
            <groupId>io.opentracing.contrib</groupId>
            <artifactId>opentracing-spring-cloud-starter</artifactId>
            <version>0.3.2</version>
        </dependency>

Yep, I will submit a fix once I know what's wrong with it