camel-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Tomohisa Igarashi <tm.igara...@gmail.com>
Subject Re: jms to kafka to jms
Date Wed, 16 Nov 2016 12:47:23 GMT
Hi,

I played with this one. So it looks you need to specify ByteArrayDeserializer at kafka consumer
side
https://github.com/igarashitm/issues/blob/master/camel/misc/src/test/java/CamelJmsKafkaBytesMessageTest.java
https://github.com/igarashitm/issues/blob/master/camel/misc/src/test/java/CamelJmsKafkaBytesMessageTest.java#L111-L112

Otherwise StringDeserializer is used anyway.

Thanks,
Tomo

On 11/16/2016 06:07 AM, Berryman, Eric wrote:
> Hello!
>
> I have two routes; one from jms(BytesMessage) to kafka, and one from kafka to jms(BytesMessage).
> When I received my jms object at the end, I noticed it is a TextMessage instead of BytesMessage.
>
> from("jms:topic:jmsTopic")
>                         .to("kafka:kafkaserver:9092?topic=jpa-cache" + "&requestRequiredAcks=-1"
>                                 + "&serializerClass=org.apache.kafka.common.serialization.ByteArraySerializer&"
>                                 + "keySerializerClass=org.apache.kafka.common.serialization.ByteArraySerializer");
>
> from("kafka:kafkaserver:9092?topic=jpa-cache&groupId=cache&autoOffsetReset=earliest&consumersCount=1")
>                     .to("jms:topic:jmsTopic");
>
> Could someone help me preserve the BytesMessage?
>
> Thank you!
> Eric
>
>

Mime
View raw message