Quarkus JMS Context propagation

171 views Asked by At

I have 3 microservices that are communicating over JMS (ActiveMQ Artemis). I am looking to implement Open Telemetry across these flows. I have tried the automated WithSpan approach but obviously the tracecontext is not propagated between services as it's async/JMS. I have tried to follow the manual context propagation approach outlined here, but then I am getting 2 errors while doing this.

  1. java.lang.IllegalArgumentException: Identifier contains invalid JMS identifier character '-': 'uber-trace-id'
  2. I can't seem to implement the setter and set the properties on the message object as i get an exception saying the properties are read-only.

Any idea how I can do this where i want to be able to trace the end-to-end flow?

1

There are 1 answers

5
Gregor Zeitlinger On

The question does not state what instrumentation library you're using, but it sounds like https://github.com/open-telemetry/opentelemetry-java-instrumentation

Identifier contains invalid JMS identifier character '-': 'uber-trace-id'

I looks like you're using message properties to send the tracecontext, which looks good. In this case, the allowed characters don't seem to match, so I'd suggest to transcode the values to a Java identifier.

i can't seem to implement the setter and set the properties on the message object as i get an exception saying the properties are read-only.

I haven't used Artemis JMS, but it looks like you have to set the properties in the client message before you create the ActiveMQMessage.