[
https://issues.apache.org/jira/browse/CAMEL-7331?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14599627#comment-14599627
]
RAHUL JAIN edited comment on CAMEL-7331 at 6/24/15 4:03 PM:
------------------------------------------------------------
This causes a critical bug.
For a camel route as follows:
from("kafka://<broker>?topic=T1")
.process(myProcessor)
.to("kafka://<broker>?topic=T2")
KafkaExchange will be created by KafkaConsumer and the topic will be set to
"T1" in the header.
For the 'to' endpoint, KafkaProducer will try to read the topic from the
exchange header which is still "T1" instead of "T2" thereby causing an infinite
loop.
For now, I am handling this by removing KafkaConstant.TOPIC from exchange
headers in myProcessor.
Perhaps we should not set this header in createExchange and let users set it
explicitly if they want.
Thoughts?
was (Author: rahulj51):
This causes a critical bug.
For a camel route as follows:
from("kafka://<broker>?topic=T1")
.process(myProcessor)
.to("kafka://<broker>?topic=T2")
KafkaExchange will be created by KafkaConsumer and the topic will be set to
"T1" in the header.
For the 'to' endpoint, KafkaProducer will try to read the topic from the
exchange header which is still "T1" insetad of "T2" thereby causing an infinite
loop.
For now, I am handling this by removing KafkaConstant.TOPIC from exchange
headers in myProcessor.
Perhaps we should not set this header in createExchange and let users set it
explicitly if they want.
Thoughts?
> Kafka: producer lookup the destination topic in the message header
> ------------------------------------------------------------------
>
> Key: CAMEL-7331
> URL: https://issues.apache.org/jira/browse/CAMEL-7331
> Project: Camel
> Issue Type: Improvement
> Affects Versions: 2.13.0
> Reporter: Fabien Chaillou
> Assignee: Claus Ibsen
> Labels: patch
> Fix For: 2.13.1, 2.14.0
>
>
> Hello,
> By default, a kafka producer is not tied to a specific topic.
> The topic is related to each message.
> Instead of having to specify the topic in the endpoint definition, we can
> define the topic as a message header.
> If no topic is defined in the message then we fall back to the topic defined
> in the endpoint if any.
> I created a pull request in github for this improvement, here is the link :
> https://github.com/apache/camel/pull/121
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)