camel-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Claus Ibsen <claus.ib...@gmail.com>
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 <bhtan1982@live.com> wrote:
> Hi,
>
>    Sorry for slow and poor understanding.
>    Is it possible to provide a more direct example. ;)
>
>    I read some post from
> http://camel.465427.n5.nabble.com/Set-exchange-property-to-a-Map-td3349171.html
>
>    <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($property.foo})"/>

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: http://camel.465427.n5.nabble.com/Correct-use-of-camelproxy-tp5719716p5719900.html
> Sent from the Camel - Users mailing list archive at Nabble.com.



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

Mime
View raw message