camel-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Quinn Stevenson <qu...@pronoia-solutions.com>
Subject Re: How to return early from a direct: subroute?
Date Sun, 03 Apr 2016 02:42:48 GMT
What about using a filter?  I think that can do what you’re after.

> On Apr 2, 2016, at 8:40 PM, bocamel <johnzyin@gmail.com> wrote:
> 
> Taariq,
> 
> 
> 
> Thank you very much for your response.  I think your suggestion is very
> interesting, though it was not exactly what I was looking for. 
> 
> 
> 
> Conceptually, to me, a direct: route is just a method call.  But I cannot
> find an easy way to exit/return from such a method before it reaches its
> end.  While one might be able to use a dynamic router with slip returning a
> null value to fake this, it is not very straightforward.  I wish there is an
> exchange property ROUTE_RETURN that simply causes the exchange to exit the
> current route and returns to the parent route if it has a parent route.
> 
> 
> 
> Thanks again!
> 
> 
> 
> From: taariq [via Camel] [mailto:ml-node+s465427n5780271h79@n5.nabble.com <mailto:ml-node+s465427n5780271h79@n5.nabble.com>]

> Sent: Friday, April 1, 2016 3:36 PM
> To: bocamel <johnzyin@gmail.com <mailto:johnzyin@gmail.com>>
> Subject: Re: How to return early from a direct: subroute?
> 
> 
> 
> Did you already look at the dynamic router and routing slip patterns? 
> 
> 
>> On 01 Apr 2016, at 17:12, bocamel <[hidden email]> wrote: 
>> 
>> I have two routes: 
>> 
>> <route id="route1"> 
>> <from .../> 
>> <to uri="direct:foo"/> 
>> <to uri=.../> 
>> </route> 
>> 
>> <route id="route2"> 
>> <from uri="direct:foo"/> 
>> <process ref="proc1"/> 
>> <process ref="proc2"/> 
>> </route> 
>> 
>> What should I do if, in proc1, I want to - for certain exchanges - return 
>> back to route1 without completing the entire route2?  I know the
> ROUTE_STOP 
>> property, but that would stop the exchange completely (without going back
> to 
>> route1).  I can also set some header(s) and then use <choice> in the
> route2 
>> to achieve it.  But I wonder if there is something analogous to ROUTE_STOP
> 
>> but more functions like ROUTE_RETURN. 
>> 
>> Any help would be greatly appreciated. 
>> 
>> 
>> 
>> 
>> -- 
>> View this message in context:
> http://camel.465427.n5.nabble.com/How-to-return-early-from-a-direct-subroute
> -tp5780262.html
>> Sent from the Camel - Users mailing list archive at Nabble.com. 
> 
> 
> 
>  _____  
> 
> If you reply to this email, your message will be added to the discussion
> below:
> 
> http://camel.465427.n5.nabble.com/How-to-return-early-from-a-direct-subroute <http://camel.465427.n5.nabble.com/How-to-return-early-from-a-direct-subroute>
> -tp5780262p5780271.html 
> 
> To unsubscribe from How to return early from a direct: subroute?, click here
> <http://camel.465427.n5.nabble.com/template/NamlServlet.jtp?macro=unsubscrib <http://camel.465427.n5.nabble.com/template/NamlServlet.jtp?macro=unsubscrib>
> e_by_code&node=5780262&code=am9obnp5aW5AZ21haWwuY29tfDU3ODAyNjJ8Mjk3Mjc3MTQ4
>> .
> 
> <http://camel.465427.n5.nabble.com/template/NamlServlet.jtp?macro=macro_view <http://camel.465427.n5.nabble.com/template/NamlServlet.jtp?macro=macro_view>
> er&id=instant_html%21nabble%3Aemail.naml&base=nabble.naml.namespaces.BasicNa
> mespace-nabble.view.web.template.NabbleNamespace-nabble.view.web.template.No
> deNamespace&breadcrumbs=notify_subscribers%21nabble%3Aemail.naml-instant_ema
> ils%21nabble%3Aemail.naml-send_instant_email%21nabble%3Aemail.naml> NAML 
> 
> 
> 
> 
> 
> --
> View this message in context: http://camel.465427.n5.nabble.com/How-to-return-early-from-a-direct-subroute-tp5780262p5780328.html
<http://camel.465427.n5.nabble.com/How-to-return-early-from-a-direct-subroute-tp5780262p5780328.html>
> Sent from the Camel - Users mailing list archive at Nabble.com <http://nabble.com/>.


Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message