Guest User

Untitled

a guest
Jul 18th, 2018
84
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.78 KB | None | 0 0
  1. camelContext.addRoute(route1);
  2. camelContext.start();
  3. while(0)
  4. {
  5. ifComplete(route1)
  6. break;
  7. }
  8. camelContext.stop();
  9.  
  10. camelContext.start();
  11. Thread.sleep(someDeterminedAmountOfTime);
  12. camelContext.stop();
  13.  
  14. CsvDataFormat csv = new CsvDataFormat();
  15. from(file:/path/to/file/?fileName=fileName&noop=true)
  16. .split(body().tokenize("/n")).streaming()
  17. .unmarshall(csv)
  18. .process(new CsvParserProcess())
  19. .marshal(csv)
  20. .to(file:/path/to/new/file/?fileName=out.csv).log("finished").end();
  21.  
  22. Main main = new org.apache.camel.spring.javaconfig.Main();
  23. var springContext = createSpringContext();
  24. main.setApplicationContext(springContext);
  25. RouteBuilder route = //create route here
  26. main.setRouteBuilders(Collections.singletonList(route));
  27. main.run();//this will block until the route completes
Add Comment
Please, Sign In to add comment