camel-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Claus Ibsen <>
Subject Re: Correct use of camelproxy + (Updating Exchange in Spring DSL)?
Date Tue, 25 Sep 2012 11:16:19 GMT
On Tue, Sep 25, 2012 at 5:36 AM, zuff <> wrote:
> Hi,
>    Sorry for slow and poor understanding.
>    Is it possible to provide a more direct example. ;)
>    I read some post from
>    <route>
>           <from uri="direct:processResult"/>
>           <bean ref="convertor"/>     [This bean take in a File object and
> return a Result object that I would like to store into the Exchange
> Properties]

Use this to set a property on the exchange, with a method call (eg
like calling a bean)
 <setProperty propertyName="foo"><method ref="convertor"/></setProperty>

>           <setProperty propertyName="foo>
>               <simple>ref:convertor</simple>   [Is this the correct way to
> do? If i had done this part correctly, can I assume Camel is able to guess
> that it need to pass this into the messageSender? ]
>           </setProperty >
>           <bean ref="strategyManager"  method="isStrategyCompleted"/>
>           <when>
>                   <simple>${body}</simple>
>                   [Need to retrieve the Result object from the Exchange
> Properties and pass it into the messageSender]
>                   <bean ref="messageSender" /> [Currently Camel is trying to
> pass the [True] into the messageSender which is excepting a Result object.
>           </when>

When invoking a bean using <bean> it may be a good idea to configure
the method name to call.

<bean ref="messageSender" method="myMethod"/>

And you can bind the parameters also, so if there is a single
parameter and you want the property on the exchange

<bean ref="messageSender" method="myMethod($})"/>

See details on the links I have previously posted.

> Current, as much as possible, I want to keep my beans as "standalone" as
> possible. Hopefully, I dun need to annotate it with the camel library as I'm
> still trying to learn more about camel and worry about timeline should I
> need to put camel aside if schedule do not permit.
> Best Regards,
> Zuff
> --
> View this message in context:
> Sent from the Camel - Users mailing list archive at

Claus Ibsen
Red Hat, Inc.
FuseSource is now part of Red Hat
Twitter: davsclaus
Author of Camel in Action:

View raw message