Hi,

You can define the method of your bean like this

import org.apache.camel.language.XPath;

public void changeStatus(String value, @XPath("//Root/Key/text()") String key) {
…...
}


--  
Willem Jiang

Red Hat, Inc.
FuseSource is now part of Red Hat
Web: http://www.fusesource.com | http://www.redhat.com
Blog: http://willemjiang.blogspot.com (http://willemjiang.blogspot.com/) 
(English)
          http://jnn.javaeye.com (http://jnn.javaeye.com/) (Chinese)
Twitter: willemjiang  
Weibo: willemjiang





On Tuesday, October 23, 2012 at 2:43 AM, praveenbillampati wrote:

> Hi,
>  
> I have below route and below is my message coming on to end point. I want to
> know is there a way where I can extract 'Key' attribute from the request and
> pass it to bean method in the context itself.
> Route:
> <route id="changeStatus">
> <from uri="direct:changeStatus" />
> <to uri="bean:changeStatusService?method=changeStatus("321", value
> extracted from message)" />
> </route>  
>  
> Message:
> <Root>
> <Key>123</Key>
> </Root>
>  
> And I need a way to pass hard coded value to the method like passing 321
> below.
> changeStatus("321",<value of Root/@Key>)
>  
> Thanks in advance!
> Praveen
>  
>  
>  
> --
> View this message in context: 
> http://camel.465427.n5.nabble.com/Configuring-camel-context-xml-to-extract-an-attribute-from-incoming-xml-message-and-pass-it-on-to-bed-tp5721411.html
> Sent from the Camel - Users mailing list archive at Nabble.com 
> (http://Nabble.com).



Reply via email to