You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@camel.apache.org by darkAR <mr...@rothtechs.com> on 2013/04/10 05:27:25 UTC

How to set spring bean into exchange property

Hello,

I would like to set a spring defined bean

<bean id="someBean" class="org.who.knows.SomeBean" scope="prototype">		
  <property name="someProperty" value="something"/>
</bean>

in a spring camel route like

<route id="someRoute">
  <from uri="{{some.starting.endpoint}}"/>
  <setProperty>
    ? what to put here ?
  </setProperty>
  <to uri="{{some.ending.endpoint}}"/>
</route>

will 

<simple>${someBean}</simple>

work?

Thanks.



--
View this message in context: http://camel.465427.n5.nabble.com/How-to-set-spring-bean-into-exchange-property-tp5730616.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: How to set spring bean into exchange property

Posted by Claus Ibsen <cl...@gmail.com>.
Hi

You can use the ref function from simple
http://camel.apache.org/simple.html

<simple>${ref:someBean}</simple>

There is a shorthand without the ${ }.
<simple>ref:someBean</simple>



On Wed, Apr 10, 2013 at 5:27 AM, darkAR <mr...@rothtechs.com> wrote:
> Hello,
>
> I would like to set a spring defined bean
>
> <bean id="someBean" class="org.who.knows.SomeBean" scope="prototype">
>   <property name="someProperty" value="something"/>
> </bean>
>
> in a spring camel route like
>
> <route id="someRoute">
>   <from uri="{{some.starting.endpoint}}"/>
>   <setProperty>
>     ? what to put here ?
>   </setProperty>
>   <to uri="{{some.ending.endpoint}}"/>
> </route>
>
> will
>
> <simple>${someBean}</simple>
>
> work?
>
> Thanks.
>
>
>
> --
> View this message in context: http://camel.465427.n5.nabble.com/How-to-set-spring-bean-into-exchange-property-tp5730616.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