camel-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From diwakar <diwakar.j...@nsn.com>
Subject Re: Camel Components as Pojos
Date Fri, 16 Dec 2011 17:45:34 GMT
Hi, 

           Thanks Babak.
           Following is 11 line Hello world code for Camel:

package org.apache.camel.example;
import org.apache.camel.ProducerTemplate;
import org.apache.camel.impl.DefaultCamelContext;
public class Hello  {
    public static void main(String[] args) throws Exception {
        DefaultCamelContext camelContext = new DefaultCamelContext();
        camelContext.start();
       
camelContext.createProducerTemplate().sendBody("file://target/test-reports?fileName=Hello.World",
"The Camel riders!");
        template.sendBody("file://target/test-reports?fileName=Hello.World",
"The Camel riders!");
        camelContext.stop();
    }
}
            This creates a file named "Hello.World" with "The Camel riders!"
content at "target/test-reports".

With Best Regards,
Diwakar


--
View this message in context: http://camel.465427.n5.nabble.com/Camel-Components-as-Pojos-tp5080073p5080943.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Mime
View raw message