You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@camel.apache.org by Christopher Gardner <ch...@gmail.com> on 2013/08/30 00:58:33 UTC

Inter-Route.Communication

I have a number of routes that do a bit of processing and then hand off to
other routes.  One of the upstream routes splits streaming data to a
downstream route.  If that downstream route encounters problems it should
notify the upstream route to stop splitting and cease processing.  What
mechanisms does camel provide to help?

Re: Inter-Route.Communication

Posted by Christian Müller <ch...@gmail.com>.
Why using a bean in your first route if you only call a direct endpoint?

Why not:
from()
  .split().streaming()
    .to("direct:sub");

Best,
Christian
Am 30.08.2013 02:28 schrieb "Christopher Gardner" <chris.r.gardner@gmail.com
>:

> I'm using stoponexception.  My splitter route includes a bean processor
> that uses producer template to push to the downstream route, which isn't a
> JMS route.  Would you show a bit of DSL that might work on my downstream
> route that could signal my upstream route an exception occurred?
> On Aug 29, 2013 7:59 PM, "Raul Kripalani" <ra...@evosent.com> wrote:
>
> > Have you tried the stopOnException() option of the Splitter?
> > Use it in combination with direct or seda endpoints. If you use JMS, you
> > can enable the transferException option to ensure that the Exception is
> > propagated back to the caller in its original form.
> >
> > Regards,
> >
> > *Raúl Kripalani*
> > Apache Camel PMC Member & Committer | Enterprise Architect, Open Source
> > Integration specialist
> > http://about.me/raulkripalani | http://www.linkedin.com/in/raulkripalani
> > http://blog.raulkr.net | twitter: @raulvk
> >
> > On Thu, Aug 29, 2013 at 11:58 PM, Christopher Gardner <
> > chris.r.gardner@gmail.com> wrote:
> >
> > > I have a number of routes that do a bit of processing and then hand off
> > to
> > > other routes.  One of the upstream routes splits streaming data to a
> > > downstream route.  If that downstream route encounters problems it
> should
> > > notify the upstream route to stop splitting and cease processing.  What
> > > mechanisms does camel provide to help?
> > >
> >
>

Re: Inter-Route.Communication

Posted by Claus Ibsen <cl...@gmail.com>.
Use stopOnException and rethrow the exception from the producer template.

On Fri, Aug 30, 2013 at 11:39 AM, Christopher Gardner
<ch...@gmail.com> wrote:
> So if I have the following:
>
> from("direct:a").split(...).streaming().bean(myBean)
>
> where myBean uses a producer template to send to direct:b when part of the
> stream is processed (we had to use this instead of an aggregator)
>
> from("direct:b).bean(myOtherBean) ...
>
> Say something went wrong in myOtherBean (an exception was raised).  What
> would be a way to tell direct:a to stop?
>
>
> On Thu, Aug 29, 2013 at 8:27 PM, Christopher Gardner <
> chris.r.gardner@gmail.com> wrote:
>
>> I'm using stoponexception.  My splitter route includes a bean processor
>> that uses producer template to push to the downstream route, which isn't a
>> JMS route.  Would you show a bit of DSL that might work on my downstream
>> route that could signal my upstream route an exception occurred?
>>  On Aug 29, 2013 7:59 PM, "Raul Kripalani" <ra...@evosent.com> wrote:
>>
>>> Have you tried the stopOnException() option of the Splitter?
>>> Use it in combination with direct or seda endpoints. If you use JMS, you
>>> can enable the transferException option to ensure that the Exception is
>>> propagated back to the caller in its original form.
>>>
>>> Regards,
>>>
>>> *Raúl Kripalani*
>>> Apache Camel PMC Member & Committer | Enterprise Architect, Open Source
>>> Integration specialist
>>> http://about.me/raulkripalani | http://www.linkedin.com/in/raulkripalani
>>> http://blog.raulkr.net | twitter: @raulvk
>>>
>>> On Thu, Aug 29, 2013 at 11:58 PM, Christopher Gardner <
>>> chris.r.gardner@gmail.com> wrote:
>>>
>>> > I have a number of routes that do a bit of processing and then hand off
>>> to
>>> > other routes.  One of the upstream routes splits streaming data to a
>>> > downstream route.  If that downstream route encounters problems it
>>> should
>>> > notify the upstream route to stop splitting and cease processing.  What
>>> > mechanisms does camel provide to help?
>>> >
>>>
>>



-- 
Claus Ibsen
-----------------
Red Hat, Inc.
Email: cibsen@redhat.com
Twitter: davsclaus
Blog: http://davsclaus.com
Author of Camel in Action: http://www.manning.com/ibsen

Re: Inter-Route.Communication

Posted by Christopher Gardner <ch...@gmail.com>.
So if I have the following:

from("direct:a").split(...).streaming().bean(myBean)

where myBean uses a producer template to send to direct:b when part of the
stream is processed (we had to use this instead of an aggregator)

from("direct:b).bean(myOtherBean) ...

Say something went wrong in myOtherBean (an exception was raised).  What
would be a way to tell direct:a to stop?


On Thu, Aug 29, 2013 at 8:27 PM, Christopher Gardner <
chris.r.gardner@gmail.com> wrote:

> I'm using stoponexception.  My splitter route includes a bean processor
> that uses producer template to push to the downstream route, which isn't a
> JMS route.  Would you show a bit of DSL that might work on my downstream
> route that could signal my upstream route an exception occurred?
>  On Aug 29, 2013 7:59 PM, "Raul Kripalani" <ra...@evosent.com> wrote:
>
>> Have you tried the stopOnException() option of the Splitter?
>> Use it in combination with direct or seda endpoints. If you use JMS, you
>> can enable the transferException option to ensure that the Exception is
>> propagated back to the caller in its original form.
>>
>> Regards,
>>
>> *Raúl Kripalani*
>> Apache Camel PMC Member & Committer | Enterprise Architect, Open Source
>> Integration specialist
>> http://about.me/raulkripalani | http://www.linkedin.com/in/raulkripalani
>> http://blog.raulkr.net | twitter: @raulvk
>>
>> On Thu, Aug 29, 2013 at 11:58 PM, Christopher Gardner <
>> chris.r.gardner@gmail.com> wrote:
>>
>> > I have a number of routes that do a bit of processing and then hand off
>> to
>> > other routes.  One of the upstream routes splits streaming data to a
>> > downstream route.  If that downstream route encounters problems it
>> should
>> > notify the upstream route to stop splitting and cease processing.  What
>> > mechanisms does camel provide to help?
>> >
>>
>

Re: Inter-Route.Communication

Posted by Christopher Gardner <ch...@gmail.com>.
I'm using stoponexception.  My splitter route includes a bean processor
that uses producer template to push to the downstream route, which isn't a
JMS route.  Would you show a bit of DSL that might work on my downstream
route that could signal my upstream route an exception occurred?
On Aug 29, 2013 7:59 PM, "Raul Kripalani" <ra...@evosent.com> wrote:

> Have you tried the stopOnException() option of the Splitter?
> Use it in combination with direct or seda endpoints. If you use JMS, you
> can enable the transferException option to ensure that the Exception is
> propagated back to the caller in its original form.
>
> Regards,
>
> *Raúl Kripalani*
> Apache Camel PMC Member & Committer | Enterprise Architect, Open Source
> Integration specialist
> http://about.me/raulkripalani | http://www.linkedin.com/in/raulkripalani
> http://blog.raulkr.net | twitter: @raulvk
>
> On Thu, Aug 29, 2013 at 11:58 PM, Christopher Gardner <
> chris.r.gardner@gmail.com> wrote:
>
> > I have a number of routes that do a bit of processing and then hand off
> to
> > other routes.  One of the upstream routes splits streaming data to a
> > downstream route.  If that downstream route encounters problems it should
> > notify the upstream route to stop splitting and cease processing.  What
> > mechanisms does camel provide to help?
> >
>

Re: Inter-Route.Communication

Posted by Raul Kripalani <ra...@evosent.com>.
Have you tried the stopOnException() option of the Splitter?
Use it in combination with direct or seda endpoints. If you use JMS, you
can enable the transferException option to ensure that the Exception is
propagated back to the caller in its original form.

Regards,

*Raúl Kripalani*
Apache Camel PMC Member & Committer | Enterprise Architect, Open Source
Integration specialist
http://about.me/raulkripalani | http://www.linkedin.com/in/raulkripalani
http://blog.raulkr.net | twitter: @raulvk

On Thu, Aug 29, 2013 at 11:58 PM, Christopher Gardner <
chris.r.gardner@gmail.com> wrote:

> I have a number of routes that do a bit of processing and then hand off to
> other routes.  One of the upstream routes splits streaming data to a
> downstream route.  If that downstream route encounters problems it should
> notify the upstream route to stop splitting and cease processing.  What
> mechanisms does camel provide to help?
>