as the other questions were already answered just a remark about add log:...

The route would also make sense without the log in some cases. Routes in camel can also use the InOut pattern.

If you call the direct endpoint with
String result = template.requestBody("test")
then the out message from the last node will be returned. This also works with jetty or even jms.

See:
http://camel.apache.org/producertemplate.html
http://camel.apache.org/using-getin-or-getout-methods-on-exchange.html


Christian


Am 20.11.2011 15:16, schrieb newbiee:
suppose we have this route:

<bean id="helloBean" class="camelinaction.HelloBean"/>
<camelContext id="camel" xmlns="http://camel.apache.org/schema/spring";>
<route>
    <from uri="direct:start"/>
    <bean ref="helloBean" method="hello"/>
</route>
</camelContext>

and we have this bean:

public class HelloBean {
public String hello(String name) {
return "Hello " + name;
}
}

My Questions:

1. In ="direct:start" , what does start refer to or is this just a name, can
it be any name?
2. Bean is expecting a parameter and will return the result. But in the
route, we are simply calling the hello method. Is this right? If there is
error, how to correct it? I have taken this from the CAMEL book. Do I need
to add this line to store the returned result:

<to uri="log:result"/>

again, can we put any name after "log:........" e.g. ="log:result"



--
View this message in context: 
http://camel.465427.n5.nabble.com/invoking-bean-from-CAMEL-route-tp5008230p5008230.html
Sent from the Camel - Users mailing list archive at Nabble.com.


--

Christian Schneider
http://www.liquid-reality.de

Open Source Architect
Talend Application Integration Division http://www.talend.com

Reply via email to