You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@servicemix.apache.org by Justin Stewart <ju...@lmco.com> on 2007/12/11 20:11:53 UTC

Camel JBI routing

Thanks for the advice.
I'm still having some trouble understanding camel routing for my existing
services.
I have a set of existing services: A, B, and C.  I would like to route them
like this:

  HTTP Request -> CamelRouteBuilder -> A -> B -> C -> HTTP Response

In my Camel RouteBuilder, I would expect to write the following route to
implement this:

    	from("jbi:service:urn:CamelRouteBuilder")
		.to("jbi:service:urn:ServiceA")
		.to("jbi:service:urn:ServiceB")
		.to("jbi:service:urn:ServiceC");

A, B, and C are existing services that expect to receive input on the
Exchange.getIn() and they send their output to Exchange.getOut().  The
output of A becomes the input of B and so forth.
This doesn't appear to be the case. When A receives it's exchange, it is an
InOnly.

http://www.nabble.com/forum/ViewPost.jtp?post=12162319&framed=y&skin=12049
This post  leads me to believe that A, B, and C should instead write their
output to the Exchange.getIn().  The In is processed through the chain - and
then C should write it's result to Exchange.getOut() - except there's no
getOut() for an InOnly Exchange.
* The additional problem with this is that C should not know (or need to
know) that it is the last processor in the route.  It should behave like
everyone else and the router should handle these details.
I'm lost somewhere in my understanding of this design.

Can someone suggest how I might be able to create the proper behavior for
this routing scenario?
Thanks.
Justin


gnodet wrote:
> 
> If you populate the out message somewhere in the camel route, it should go
> back to the http consumer.
> You can do that using a camel processor (
> http://activemq.apache.org/camel/maven/camel-core/apidocs/org/apache/camel/Processor.html
> ).
> I can't recall the exact xml syntax, but i'm sure you'll find it in camel
> examples.
> 
> On Dec 3, 2007 10:31 PM, Justin Stewart <ju...@lmco.com> wrote:
> 
>>
>> Thanks - that worked great.
>>
>> I have one more related question that there may be an easy answer to ...
>> (I
>> haven't seen a related camel example to glean from)
>>
>> I will want to return a document to the HTTP requester, but I'm not sure
>> how
>> to do that.  Especially since I really don't know where the document came
>> from (nothing to put in a to() call).
>> I just know that someone sent a document to my interfaceRules service.
>>
>> Thanks.
>> Justin
> 

-- 
View this message in context: http://www.nabble.com/Camel-JBI-namespace-handling-tp14138742s12049p14280913.html
Sent from the ServiceMix - User mailing list archive at Nabble.com.