You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@camel.apache.org by "Andreas Mattes (JIRA)" <ji...@apache.org> on 2018/04/17 18:25:00 UTC

[jira] [Created] (CAMEL-12453) Custem serializers referenced in a Camel Kafka endpoint URL cannot be resolved

Andreas Mattes created CAMEL-12453:
--------------------------------------

             Summary: Custem serializers referenced in a Camel Kafka endpoint URL cannot be resolved
                 Key: CAMEL-12453
                 URL: https://issues.apache.org/jira/browse/CAMEL-12453
             Project: Camel
          Issue Type: Bug
          Components: camel-kafka
    Affects Versions: 2.21.0
            Reporter: Andreas Mattes
         Attachments: Kafka-serializer-classloading-src.tar.gz, Kafka-serializer-classloading-test.tar.gz

In Camel Kafka endpoint URLs, serializer and deserializer classes can be set as parameters. These are set as Strings (class names) and resolved to classes in the scope of the Kafka client. In environments with restrictive class loading like OSGi, camel-karaf ensures that Kafka classes can be resolved properly by setting the context class loader to the class loader of the Kafka client classes. However, this setting makes it impossible to reference custom serializers in the Kafka endpoint URL, because these cannot be resolved by the Kafka class loader and let Kafka producer and/or consumer creation fail with a ClassNotFoundException.

The attached file "Kafka-serializer-classloading-test.tar.gz" contains a test derived from a camel-kafka unit test which demonstrates the serializer class loading issue.

The attached file "Kafka-serializer-classloading-src.tar.gz" contains class sources of a proposal for a fix of this issue.

The content of both files is derived from Camel 2.21.0.



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