You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@camel.apache.org by Dennis Holunder <de...@gmail.com> on 2020/12/28 13:59:44 UTC
How to block on direct route
Hello,
What is the correct way to block on a "direct" route until completion?
In the route below I must ensure only one instance of "direct:process"
route running. In other words, "direct:process" must not run in
parallel, because of some state
from("timer://first?period=1000")
.to("direct:process");
from("timer://second?period=5000")
.to("direct:process");
from("direct:process")
.log("processing");
Thanks!
Re: How to block on direct route
Posted by Claus Ibsen <cl...@gmail.com>.
Hi
That is not the goal of direct component.
If you want single threaded / sequential processing then use seda,
where there is 1 consumer by default.
On Mon, Dec 28, 2020 at 3:00 PM Dennis Holunder <de...@gmail.com> wrote:
>
> Hello,
>
> What is the correct way to block on a "direct" route until completion?
> In the route below I must ensure only one instance of "direct:process"
> route running. In other words, "direct:process" must not run in
> parallel, because of some state
>
> from("timer://first?period=1000")
> .to("direct:process");
> from("timer://second?period=5000")
> .to("direct:process");
> from("direct:process")
> .log("processing");
>
> Thanks!
--
Claus Ibsen
-----------------
http://davsclaus.com @davsclaus
Camel in Action 2: https://www.manning.com/ibsen2