[ 
https://issues.apache.org/jira/browse/CAMEL-12573?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16509775#comment-16509775
 ] 

ASF GitHub Bot commented on CAMEL-12573:
----------------------------------------

GitHub user akhettar opened a pull request:

    https://github.com/apache/camel/pull/2372

    CAMEL-12573: Fixing class cast exception

    I have introduced a generic method which extracts the values of the 
`Partition` and the `Offset` from the Exchange headers according to their 
corresponding types.
    
    Here is the Jira ticket for 
it.https://issues.apache.org/jira/browse/CAMEL-12573

You can merge this pull request into a Git repository by running:

    $ git pull https://github.com/akhettar/camel master

Alternatively you can review and apply these changes as the patch at:

    https://github.com/apache/camel/pull/2372.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

    This closes #2372
    
----
commit aa9464cdd8a30ff9a88bf893999158ec7c8ae40e
Author: akhettar <ayache@...>
Date:   2018-06-12T15:31:12Z

    Fixing class cast exception. Handling kafka.Partition as Integer and 
kafka.Offset as a Long.

----


> ClassCastException thrown KafkaSpanDecorator
> --------------------------------------------
>
>                 Key: CAMEL-12573
>                 URL: https://issues.apache.org/jira/browse/CAMEL-12573
>             Project: Camel
>          Issue Type: Bug
>          Components: camel-opentracing
>            Reporter: ayache khettar
>            Priority: Major
>
> ClassCastException is thrown by `KafkaSpanDecorator` for the Partition and 
> the Offset header values. The fix to this is to cast the partition to an 
> Integer and the Offset to a Long. I have got a fix and I will raise a pull 
> request shortly.
>  
>  
> {code:java}
> 2018-06-12 16:36:26.224 WARN 34820 --- [kaConsumer[ocr]] 
> o.a.camel.opentracing.OpenTracingTracer : OpenTracing: Failed to capture 
> tracing data
> java.lang.ClassCastException: java.lang.Integer cannot be cast to 
> java.lang.String
> at 
> org.apache.camel.opentracing.decorators.KafkaSpanDecorator.pre(KafkaSpanDecorator.java:61)
>  ~[camel-opentracing-2.21.0.jar:2.21.0]
> at 
> org.apache.camel.opentracing.OpenTracingTracer$OpenTracingRoutePolicy.onExchangeBegin(OpenTracingTracer.java:297)
>  ~[camel-opentracing-2.21.0.jar:2.21.0]
> at 
> org.apache.camel.processor.CamelInternalProcessor$RoutePolicyAdvice.before(CamelInternalProcessor.java:495)
>  [camel-core-2.21.0.jar:2.21.0]
> at 
> org.apache.camel.processor.CamelInternalProcessor.process(CamelInternalProcessor.java:149)
>  [camel-core-2.21.0.jar:2.21.0]
> at 
> org.apache.camel.processor.DelegateAsyncProcessor.process(DelegateAsyncProcessor.java:97)
>  [camel-core-2.21.0.jar:2.21.0]
> at 
> org.apache.camel.component.kafka.KafkaConsumer$KafkaFetchRecords.doRun(KafkaConsumer.java:295)
>  [camel-kafka-2.21.0.jar:2.21.0]
> at 
> org.apache.camel.component.kafka.KafkaConsumer$KafkaFetchRecords.run(KafkaConsumer.java:187)
>  [camel-kafka-2.21.0.jar:2.21.0]
> at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) 
> [na:1.8.0_151]
> at java.util.concurrent.FutureTask.run(FutureTask.java:266) [na:1.8.0_151]
> at 
> java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
>  [na:1.8.0_151]
> at 
> java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
>  [na:1.8.0_151]
> at java.lang.Thread.run(Thread.java:748) [na:1.8.0_151]
> {code}{code}



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Reply via email to