You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@camel.apache.org by Vyacheslav Boyko <ma...@gmail.com> on 2021/06/21 12:53:48 UTC
Tell me about moving messages from one route to another and manual
Kafka commit
Hi!
It's the first time I use Kafka + Camel chain.
And... what if I have following routes:
// 1 route
from("kafka://my-topic?allowManualCommit=true&autoCommitEnable=false")
.process(someProcessor)
.choice()
.when(simple("${body} == "MY-CONDITION")
.to("seda://yes-queue")
.otherwise()
.to("seda://no-queue")
.end();
// 2 route
from("seda://yes-route")
.process(processorYes);
// 3 route
from("seda://no-route")
.process(processorNo);
Am I right saying that all incoming messages will pass through 1 route
then 2 or 3 route (conditionally) and will park into processorYes or
processorNo. Am I able to perform commit Kafka message not only in 1
route? I mean, am I right that Camel will pass exactly one instance of
Exchange from route 1 to route 2 or 3 and I will be able to perform
Kafka commit in route 2? Or do Camel do something with Kafka fetching
makes me being not able to commit Kafka message in next (after Kafka
consuming) route?
--
Vyacheslav Boyko
aka bvn13
mailto:mail4bvn@gmail.com
Re: Tell me about moving messages from one route to another and
manual Kafka commit
Posted by Andrea Cosentino <an...@gmail.com>.
Yes, with direct it should fine.
Il giorno lun 21 giu 2021 alle ore 17:08 Vyacheslav Boyko <
mail4bvn@gmail.com> ha scritto:
> So... Am I able to use "direct" instead of "seda", right?
>
>
> On Mon, 21 Jun 2021 14:49:50 +0000 (UTC)
> Andrea Cosentino <an...@yahoo.com.INVALID> wrote:
>
> > Hello,
> >
> > The manual commit needs to be done is the same thread of the kafka
> > consumer, so you cannot do this in route 2 or route 3.
> >
> > --
> > Andrea Cosentino
> > ----------------------------------
> > Apache Camel PMC Chair
> > Apache Karaf Committer
> > Apache Servicemix PMC Member
> > Email: ancosen1985@yahoo.com
> > Twitter: @oscerd2
> > Github: oscerd
> >
> >
> >
> >
> >
> >
> > On Monday, June 21, 2021, 02:54:00 PM GMT+2, Vyacheslav Boyko
> > <ma...@gmail.com> wrote:
> >
> >
> >
> >
> >
> > Hi!
> >
> > It's the first time I use Kafka + Camel chain.
> > And... what if I have following routes:
> >
> > // 1 route
> > from("kafka://my-topic?allowManualCommit=true&autoCommitEnable=false")
> > .process(someProcessor)
> > .choice()
> > .when(simple("${body} == "MY-CONDITION")
> > .to("seda://yes-queue")
> > .otherwise()
> > .to("seda://no-queue")
> > .end();
> >
> > // 2 route
> > from("seda://yes-route")
> > .process(processorYes);
> >
> > // 3 route
> > from("seda://no-route")
> > .process(processorNo);
> >
> > Am I right saying that all incoming messages will pass through 1 route
> > then 2 or 3 route (conditionally) and will park into processorYes or
> > processorNo. Am I able to perform commit Kafka message not only in 1
> > route? I mean, am I right that Camel will pass exactly one instance of
> > Exchange from route 1 to route 2 or 3 and I will be able to perform
> > Kafka commit in route 2? Or do Camel do something with Kafka fetching
> > makes me being not able to commit Kafka message in next (after Kafka
> > consuming) route?
> >
> >
>
>
Re: Tell me about moving messages from one route to another and
manual Kafka commit
Posted by Vyacheslav Boyko <ma...@gmail.com>.
So... Am I able to use "direct" instead of "seda", right?
On Mon, 21 Jun 2021 14:49:50 +0000 (UTC)
Andrea Cosentino <an...@yahoo.com.INVALID> wrote:
> Hello,
>
> The manual commit needs to be done is the same thread of the kafka
> consumer, so you cannot do this in route 2 or route 3.
>
> --
> Andrea Cosentino
> ----------------------------------
> Apache Camel PMC Chair
> Apache Karaf Committer
> Apache Servicemix PMC Member
> Email: ancosen1985@yahoo.com
> Twitter: @oscerd2
> Github: oscerd
>
>
>
>
>
>
> On Monday, June 21, 2021, 02:54:00 PM GMT+2, Vyacheslav Boyko
> <ma...@gmail.com> wrote:
>
>
>
>
>
> Hi!
>
> It's the first time I use Kafka + Camel chain.
> And... what if I have following routes:
>
> // 1 route
> from("kafka://my-topic?allowManualCommit=true&autoCommitEnable=false")
> .process(someProcessor)
> .choice()
> .when(simple("${body} == "MY-CONDITION")
> .to("seda://yes-queue")
> .otherwise()
> .to("seda://no-queue")
> .end();
>
> // 2 route
> from("seda://yes-route")
> .process(processorYes);
>
> // 3 route
> from("seda://no-route")
> .process(processorNo);
>
> Am I right saying that all incoming messages will pass through 1 route
> then 2 or 3 route (conditionally) and will park into processorYes or
> processorNo. Am I able to perform commit Kafka message not only in 1
> route? I mean, am I right that Camel will pass exactly one instance of
> Exchange from route 1 to route 2 or 3 and I will be able to perform
> Kafka commit in route 2? Or do Camel do something with Kafka fetching
> makes me being not able to commit Kafka message in next (after Kafka
> consuming) route?
>
>
Re: Tell me about moving messages from one route to another and
manual Kafka commit
Posted by Andrea Cosentino <an...@yahoo.com.INVALID>.
Hello,
The manual commit needs to be done is the same thread of the kafka consumer, so you cannot do this in route 2 or route 3.
--
Andrea Cosentino
----------------------------------
Apache Camel PMC Chair
Apache Karaf Committer
Apache Servicemix PMC Member
Email: ancosen1985@yahoo.com
Twitter: @oscerd2
Github: oscerd
On Monday, June 21, 2021, 02:54:00 PM GMT+2, Vyacheslav Boyko <ma...@gmail.com> wrote:
Hi!
It's the first time I use Kafka + Camel chain.
And... what if I have following routes:
// 1 route
from("kafka://my-topic?allowManualCommit=true&autoCommitEnable=false")
.process(someProcessor)
.choice()
.when(simple("${body} == "MY-CONDITION")
.to("seda://yes-queue")
.otherwise()
.to("seda://no-queue")
.end();
// 2 route
from("seda://yes-route")
.process(processorYes);
// 3 route
from("seda://no-route")
.process(processorNo);
Am I right saying that all incoming messages will pass through 1 route
then 2 or 3 route (conditionally) and will park into processorYes or
processorNo. Am I able to perform commit Kafka message not only in 1
route? I mean, am I right that Camel will pass exactly one instance of
Exchange from route 1 to route 2 or 3 and I will be able to perform
Kafka commit in route 2? Or do Camel do something with Kafka fetching
makes me being not able to commit Kafka message in next (after Kafka
consuming) route?
--
Vyacheslav Boyko
aka bvn13
mailto:mail4bvn@gmail.com