Monday, 14 August 2017

Apache Camel

Apache Camel: -



Apache Camel is a rule-based routing and mediation engine that provides a Java object-based implementation of the Enterprise Integration Patterns using an application programming interface (or declarative Java domain-specific language) to configure routing and mediation rules.
For details please visit –

Example:-
package com.test.main;

import org.apache.camel.CamelContext;
import org.apache.camel.builder.RouteBuilder;
import org.apache.camel.impl.DefaultCamelContext;

public class Test1 {
 public static void main(String[] args) throws Exception {
     CamelContext context = new DefaultCamelContext();
     context.addRoutes(new RouteBuilder() {
     @Override
     public void configure() throws Exception {
       from("file:D:\\input?noop=true").log("Read from the input file").to("file:D:\\output") .log("Written to output file");;
              }
      });    
     context.start();
     Thread.sleep(1000);
     context.stop();
 }
}

1 comment: