You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@camel.apache.org by Sanu Sandesh <mu...@gmail.com> on 2020/03/31 09:57:48 UTC
Fwd: Camel-kafka integration issue
Team,
I am trying to integrate Camel with Kafka. Written simple application with
camelcontext initialized in main() program & added my routebuilder with
below code:
from("direct:start")
.setBody(constant("Message from Camel")) // Message to send
.setHeader(KafkaConstants.KEY, constant("Camel")) // Key of
the message
.to("kafka:test?brokers=localhost:2181");
where my topic is : test
This code not sending message to my kafka consumer. where as plain kafka
code is sending. I am trying to see consumer using CLI.
Need assistance pls.
REgards,
Sandesh
Re: Camel-kafka integration issue
Posted by Omar Al-Safi <om...@oalsafi.com>.
You can take a look at this example
<https://github.com/apache/camel-examples/tree/master/examples/camel-example-kafka>
which
explains this in good details.
Regards,
Omar
On Tue, Mar 31, 2020 at 2:20 PM Andrea Cosentino <an...@gmail.com> wrote:
> You need to send something to direct. As it is you're not sending messages
> to your route.
>
> Use a timer.
>
> Il giorno mar 31 mar 2020 alle ore 14:18 Sanu Sandesh <
> muralisandesh24@gmail.com> ha scritto:
>
> > Team,
> >
> > I am trying to integrate Camel with Kafka. Written simple application
> with
> > camelcontext initialized in main() program & added my routebuilder with
> > below code:
> >
> > from("direct:start")
> > .setBody(constant("Message from Camel")) // Message to
> send
> > .setHeader(KafkaConstants.KEY, constant("Camel")) // Key
> of
> > the message
> > .to("kafka:test?brokers=localhost:2181");
> >
> > where my topic is : test
> >
> > This code not sending message to my kafka consumer. where as plain kafka
> > code is sending. I am trying to see consumer using CLI.
> >
> > Need assistance pls.
> >
> > REgards,
> > Sandesh
> >
>
Re: Camel-kafka integration issue
Posted by Andrea Cosentino <an...@gmail.com>.
You need to send something to direct. As it is you're not sending messages
to your route.
Use a timer.
Il giorno mar 31 mar 2020 alle ore 14:18 Sanu Sandesh <
muralisandesh24@gmail.com> ha scritto:
> Team,
>
> I am trying to integrate Camel with Kafka. Written simple application with
> camelcontext initialized in main() program & added my routebuilder with
> below code:
>
> from("direct:start")
> .setBody(constant("Message from Camel")) // Message to send
> .setHeader(KafkaConstants.KEY, constant("Camel")) // Key of
> the message
> .to("kafka:test?brokers=localhost:2181");
>
> where my topic is : test
>
> This code not sending message to my kafka consumer. where as plain kafka
> code is sending. I am trying to see consumer using CLI.
>
> Need assistance pls.
>
> REgards,
> Sandesh
>