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: How to get Exchange from a within a POJO without changing the interface?
Date Tue, 26 Jul 2011 06:06:08 GMT
On Tue, Jul 26, 2011 at 7:39 AM, Jim Talbut <jtalbut@spudsoft.co.uk> wrote:
> Hi,
>
> I have a POJO that benefits from having a non-Camel interface (it means I
> can know that the interface matches that of a given web service).
>
> Internally this POJO needs to extract a couple of properties from the
> Exchange.
>
> Is there any way to get the "currently executing Exchange" without adding it
> as a parameter to the POJO?
> Most useful for me would be either a static method or a method on the
> CamelContext, because they would allow me to move the Camel-specific
> processing into a separate bean.
>

On trunk I have improved the bean component, so you can bind the
parameters in the method name option.
.to"(bean:myBean?method=myMethod(${body}, ${header.foo},
${header.bar}, 'This is a String'")

More details at:
http://camel.apache.org/bean-binding.html



> Thanks
>
> Jim
>



-- 
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/

Mime
View raw message