camel-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Jay mann (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (CAMEL-10087) camel-kafka does not work in OSGI container
Date Fri, 24 Jun 2016 15:36:16 GMT

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

Jay mann commented on CAMEL-10087:
----------------------------------

I can walk you through their code:

For example when you Create producer it creates the serializers:

this.keySerializer = config.getConfiguredInstance(ProducerConfig.KEY_SERIALIZER_CLASS_CONFIG,
                        Serializer.class);

https://github.com/apache/kafka/blob/trunk/clients/src/main/java/org/apache/kafka/clients/producer/KafkaProducer.java#L305

Which calls into AbstractConfig.java
https://github.com/apache/kafka/blob/trunk/clients/src/main/java/org/apache/kafka/common/config/AbstractConfig.java#L197

Which calls into Utils.newInstance
https://github.com/apache/kafka/blob/trunk/clients/src/main/java/org/apache/kafka/common/utils/Utils.java#L332

Which finally calls 
Utils.getContextOrKafkaClassLoader()

which uses the current classloader if it is set to null.  

So as you can see serializers and partitioners are created by the Utils class.  

Utils is inside the same bundle as all the Karaf stuff, that is why it needs to use the same
class loader as Utils not of the calling thread.




> camel-kafka does not work in OSGI container
> -------------------------------------------
>
>                 Key: CAMEL-10087
>                 URL: https://issues.apache.org/jira/browse/CAMEL-10087
>             Project: Camel
>          Issue Type: Bug
>          Components: camel-kafka
>    Affects Versions: 2.17.1
>            Reporter: Jay mann
>
> Currently this component is broken in OSGI environment due to this:
> https://issues.apache.org/jira/browse/KAFKA-3218
> We can leave it broken until they get their bugs worked out.  Or i can submit a PR with
an intermediate fix that should work, as described in the jira noted above.
> https://github.com/apache/camel/pull/1049



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Mime
View raw message