You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@camel.apache.org by "Andrea Cosentino (Jira)" <ji...@apache.org> on 2020/07/13 09:56:00 UTC

[jira] [Assigned] (CAMEL-15022) Opentracing doesn't work with Kafka Component

     [ https://issues.apache.org/jira/browse/CAMEL-15022?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Andrea Cosentino reassigned CAMEL-15022:
----------------------------------------

    Assignee: Andrea Cosentino  (was: Viral Gohel)

> Opentracing doesn't work with Kafka Component
> ---------------------------------------------
>
>                 Key: CAMEL-15022
>                 URL: https://issues.apache.org/jira/browse/CAMEL-15022
>             Project: Camel
>          Issue Type: Bug
>          Components: camel-opentracing
>    Affects Versions: 2.23.4
>            Reporter: Gerald Nunn
>            Assignee: Andrea Cosentino
>            Priority: Minor
>             Fix For: 2.25.2, 3.5.0, 3.4.2
>
>
> In Kafka the headers are stored as byte arrays rather then string. OpenTracing with Jaeger inserts a string header uber-trace-id which works. However when it tries to read it as a string when the message is consumed it presumably does a toString which doesn't return the actual string since the header is returned as a byte array.
> This can be worked around by using a KafkaHeaderDeserializer as per here:
> https://github.com/gnunn1/seating/blob/master/seat-listener/src/main/java/com/redhat/demo/HeaderDeserializer.java
> Note you need to deserialize the kafka.TOPIC as well since the KafkaSpanDecorator tries to cast the header as a string which fails the header is returned as byte array.
> https://github.com/apache/camel/blob/camel-2.23.x/components/camel-opentracing/src/main/java/org/apache/camel/opentracing/decorators/KafkaSpanDecorator.java#L49
>  



--
This message was sent by Atlassian Jira
(v8.3.4#803005)