pom.xml:
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>com.erik.camel</groupId>
<artifactId>FilesTransfer</artifactId>
<version>0.0.1-SNAPSHOT</version>
<packaging>jar</packaging>
<name>FilesTransfer</name>
<url>http://maven.apache.org</url>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>
<dependencies>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.10</version>
</dependency>
<dependency>
<groupId>org.apache.camel</groupId>
<artifactId>camel-core</artifactId>
<version>2.13.1</version>
</dependency>
<dependency>
<groupId>log4j</groupId>
<artifactId>log4j</artifactId>
<version>1.2.17</version>
</dependency>
</dependencies>
</project>
log4j.properties:
log4j.appender.stdout = org.apache.log4j.ConsoleAppender
log4j.appender.stdout.Target = System.out
log4j.appender.stdout.layout = org.apache.log4j.PatternLayout
log4j.appender.stdout.layout.ConversionPattern = %-5p %d [%t] %c: %m%n
log4j.rootLogger = debug,stdout
java:
package com.erik.camel.filetransfer;
import org.apache.camel.CamelContext;
import org.apache.camel.Exchange;
import org.apache.camel.Processor;
import org.apache.camel.builder.RouteBuilder;
import org.apache.camel.impl.DefaultCamelContext;
public class CamelBasicExample {
public static void main(String[] args) throws Exception {
CamelContext context = new DefaultCamelContext();
context.addRoutes(new RouteBuilder() {
@Override
public void configure() throws Exception {
//http://www.ayandy.com/Service.asmx?wsdl
from("file:C:/Camel?delay=3000")
.process(new Processor() {
public void process(Exchange exchange) throws Exception {
Object inBody = exchange.getIn().getBody();
System.out.println(inBody);
}
})
.log("Erik")
.to("file:C:/temp/outbox");
}
});
context.start();
boolean loop = true;
while (loop) {
Thread.sleep(2500);
}
context.stop();
}
}
java2:
package com.erik.camel.filetransfer;
import org.apache.camel.CamelContext;
import org.apache.camel.builder.RouteBuilder;
import org.apache.camel.impl.DefaultCamelContext;
public class FileMoveWithCamel {
public static void main(String args[]) throws Exception {
CamelContext context = new DefaultCamelContext();
context.addRoutes(new RouteBuilder() {
public void configure() {
// from("file:d:/temp/inbox?noop=true").to("file:d:/temp/outbox");
from("file:C:/Camel?delay=3000")
.to("file:C:/temp/outbox");
}
});
context.start();
boolean loop = true;
while (loop) {
Thread.sleep(2500);
}
context.stop();
}
}
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>com.erik.camel</groupId>
<artifactId>FilesTransfer</artifactId>
<version>0.0.1-SNAPSHOT</version>
<packaging>jar</packaging>
<name>FilesTransfer</name>
<url>http://maven.apache.org</url>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>
<dependencies>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.10</version>
</dependency>
<dependency>
<groupId>org.apache.camel</groupId>
<artifactId>camel-core</artifactId>
<version>2.13.1</version>
</dependency>
<dependency>
<groupId>log4j</groupId>
<artifactId>log4j</artifactId>
<version>1.2.17</version>
</dependency>
</dependencies>
</project>
log4j.properties:
log4j.appender.stdout = org.apache.log4j.ConsoleAppender
log4j.appender.stdout.Target = System.out
log4j.appender.stdout.layout = org.apache.log4j.PatternLayout
log4j.appender.stdout.layout.ConversionPattern = %-5p %d [%t] %c: %m%n
log4j.rootLogger = debug,stdout
java:
package com.erik.camel.filetransfer;
import org.apache.camel.CamelContext;
import org.apache.camel.Exchange;
import org.apache.camel.Processor;
import org.apache.camel.builder.RouteBuilder;
import org.apache.camel.impl.DefaultCamelContext;
public class CamelBasicExample {
public static void main(String[] args) throws Exception {
CamelContext context = new DefaultCamelContext();
context.addRoutes(new RouteBuilder() {
@Override
public void configure() throws Exception {
//http://www.ayandy.com/Service.asmx?wsdl
from("file:C:/Camel?delay=3000")
.process(new Processor() {
public void process(Exchange exchange) throws Exception {
Object inBody = exchange.getIn().getBody();
System.out.println(inBody);
}
})
.log("Erik")
.to("file:C:/temp/outbox");
}
});
context.start();
boolean loop = true;
while (loop) {
Thread.sleep(2500);
}
context.stop();
}
}
java2:
package com.erik.camel.filetransfer;
import org.apache.camel.CamelContext;
import org.apache.camel.builder.RouteBuilder;
import org.apache.camel.impl.DefaultCamelContext;
public class FileMoveWithCamel {
public static void main(String args[]) throws Exception {
CamelContext context = new DefaultCamelContext();
context.addRoutes(new RouteBuilder() {
public void configure() {
// from("file:d:/temp/inbox?noop=true").to("file:d:/temp/outbox");
from("file:C:/Camel?delay=3000")
.to("file:C:/temp/outbox");
}
});
context.start();
boolean loop = true;
while (loop) {
Thread.sleep(2500);
}
context.stop();
}
}