camel-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Mark Mindenhall (JIRA)" <j...@apache.org>
Subject [jira] [Comment Edited] (CAMEL-8790) Kafka producer hard coded to use Strings
Date Tue, 26 May 2015 17:26:17 GMT

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

Mark Mindenhall edited comment on CAMEL-8790 at 5/26/15 5:25 PM:
-----------------------------------------------------------------

When you apply this patch, please also upgrade the kafka version to 0.8.2.1.  I believe there
were some serious bugs in 0.8.2.0, which is why 0.8.2.1 was released so quickly. Edit:  I
created CAMEL-8800 to address this.


was (Author: mmindenhall):
When you apply this patch, please also upgrade the kafka version to 0.8.2.1.  I believe there
were some serious bugs in 0.8.2.0, which is why 0.8.2.1 was released so quickly.

> Kafka producer hard coded to use Strings
> ----------------------------------------
>
>                 Key: CAMEL-8790
>                 URL: https://issues.apache.org/jira/browse/CAMEL-8790
>             Project: Camel
>          Issue Type: Improvement
>          Components: camel-kafka
>    Affects Versions: 2.14.2, 2.15.2, 2.16.0
>            Reporter: Mark Mindenhall
>            Assignee: Willem Jiang
>             Fix For: 2.16.0
>
>         Attachments: 0001-CAMEL-8790-Fix-for-Kafka-producer-hard-coded-to-use-.patch
>
>
> Kafka natively supports two encoders for messages:
> # {{kafka.serializer.DefaultEncoder}} - encodes as byte arrays
> # {{kafka.serializer.StringEncoder}} - encodes as Strings
> Camel-kafka exposes settings to select the encoder (({{serializerClass}} and {{keySerializerClass}}),
but the {{org.apache.camel.component.kafka.KafkaProducer}} class hard-codes String for both
the key and value types.  This results in a {{ClassCastException}} when using the {{DefaultDecoder}}.
> The attached patch fixes this as follows (conforming to kafka itself):
> * If no {{serializerClass}} option is specified, the {{DefaultDecoder}} is used.
> * If no {{keySerializerClass}} option is specified, the same encoder as {{serializerClass}}
is used
> This fix shouldn't break any existing code, as there was not previously a default setting
(i.e., {{StringEncoder}} always had to be specified).
> I created the patch against master, but it should backport easily to 2.15.x and 2.14.x.



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

Mime
View raw message