You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@camel.apache.org by xiangqiuzhao <xi...@gmail.com> on 2011/08/14 05:21:56 UTC

how to process sync exchange mode?

my route like
from("direct://test").process("convertOut").to("mycompomnent").process("convertIn")

i need to send local message to mycompomnent, but i need to convert message
to the format before send and mycompomnent is sync mode, so i need to
convert the response message to my format after get response.

i must use two processor to handle?

how to use route like
from("direct://test").process("converter").to("mycompomnent")

in the process converter, i how to know what the request from direct and
response from mycompomnent?

--
View this message in context: http://camel.465427.n5.nabble.com/how-to-process-sync-exchange-mode-tp4697451p4697451.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: how to process sync exchange mode?

Posted by Claus Ibsen <cl...@gmail.com>.
On Sun, Aug 14, 2011 at 5:21 AM, xiangqiuzhao <xi...@gmail.com> wrote:
> my route like
> from("direct://test").process("convertOut").to("mycompomnent").process("convertIn")
>
> i need to send local message to mycompomnent, but i need to convert message
> to the format before send and mycompomnent is sync mode, so i need to
> convert the response message to my format after get response.
>
> i must use two processor to handle?
>
> how to use route like
> from("direct://test").process("converter").to("mycompomnent")
>
> in the process converter, i how to know what the request from direct and
> response from mycompomnent?


You need to put the converters before and after the mycomponent.
from("direct://test").process("beforeConverter").to("mycompomnent").process("afterConverter")

You may also consider enhancing mycomponent to be able to do the
before conversion itself.
Also Camel provides a built in type converter system
http://camel.apache.org/type-converter.html




>
> --
> View this message in context: http://camel.465427.n5.nabble.com/how-to-process-sync-exchange-mode-tp4697451p4697451.html
> Sent from the Camel - Users mailing list archive at Nabble.com.
>



-- 
Claus Ibsen
-----------------
FuseSource
Email: cibsen@fusesource.com
Web: http://fusesource.com
Twitter: davsclaus, fusenews
Blog: http://davsclaus.blogspot.com/
Author of Camel in Action: http://www.manning.com/ibsen/