@newbiee, a lot of your questions would be answered by reading through the camel wiki and looking at the code/tests. Reading the manual [1] (older versions in pdf and html are also available [2]) may also be very helpful and an excellent starting point.

Cheers,
Hadrian

[1] http://camel.apache.org/manual/camel-manual-2.8.0.pdf
[2] http://camel.apache.org/manual/


On 11/20/2011 04:42 PM, Christian Schneider wrote:
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.



--
Hadrian Zbarcea
Principal Software Architect
Talend, Inc
http://coders.talend.com/
http://camelbot.blogspot.com/

Reply via email to