On Thu, Jan 24, 2013 at 12:32 PM, AMARNATH, Balachandar <balachandar.amarn...@airbus.com> wrote: > I am new to camel and trying to run a simple example. I have the following > classes constitute a simple route which I am not able to run it. > > public class CamelStarter { > > /** > * @param args > */ > public static void main(String[] args) throws Exception { > // TODO Auto-generated method stub > CamelContext context = new DefaultCamelContext(); > context.addRoutes((RoutesBuilder) new IntegrationRoute()); > context.start(); > context.stop(); > > } > > } >
Hi See this FAQ http://camel.apache.org/running-camel-standalone-and-have-it-keep-running.html You need to keep Camel running, as you start + stop it asap > > public class IntegrationRoute extends RouteBuilder { > > @Override > public void configure() throws Exception { > from("file:///home/bala/input.txt").process(new > simpleProcessor()).toString(); > > } > > } > > public class simpleProcessor implements Processor { > > @Override > public void process(Exchange arg0) throws Exception { > // TODO Auto-generated method stub > System.out.println("Received > "+arg0.getIn().getBody(String.class)); > } > > } > > > I compiled all the classes and ran CamelStarter class. It goes to the > configure() method and after that, I am not seeing any more output. No error. > I expect the code in process() be executed and print something which is not > happening. > Can someone give me a hint here? > > > Many thanks and regards > Bala > > > > With thanks and regards > Balachandar > > > > > The information in this e-mail is confidential. The contents may not be > disclosed or used by anyone other than the addressee. Access to this e-mail > by anyone else is unauthorised. > If you are not the intended recipient, please notify Airbus immediately and > delete this e-mail. > Airbus cannot accept any responsibility for the accuracy or completeness of > this e-mail as it has been sent over public networks. If you have any > concerns over the content of this message or its Accuracy or Integrity, > please contact Airbus immediately. > All outgoing e-mails from Airbus are checked using regularly updated virus > scanning software but you should take whatever measures you deem to be > appropriate to ensure that this message and any attachments are virus free. > -- Claus Ibsen ----------------- Red Hat, Inc. FuseSource is now part of Red Hat Email: cib...@redhat.com Web: http://fusesource.com Twitter: davsclaus Blog: http://davsclaus.com Author of Camel in Action: http://www.manning.com/ibsen