INT-1477 restructuring samples repo to have basic, intermediate, advancedand applications directories
This commit is contained in:
@@ -0,0 +1,24 @@
|
||||
/**
|
||||
*
|
||||
*/
|
||||
package org.springframework.integration.samples.fileprocessing;
|
||||
|
||||
import java.io.File;
|
||||
import java.util.Random;
|
||||
|
||||
import org.apache.log4j.Logger;
|
||||
|
||||
/**
|
||||
* @author ozhurakousky
|
||||
*
|
||||
*/
|
||||
public class FileProcessor {
|
||||
private Random random = new Random();
|
||||
private Logger logger = Logger.getLogger(FileProcessor.class);
|
||||
|
||||
public File process(File file) throws Exception{
|
||||
Thread.sleep(random.nextInt(10)*500);
|
||||
logger.info("Processing File: " + file);
|
||||
return file;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,27 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<beans xmlns="http://www.springframework.org/schema/beans"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
|
||||
http://www.springframework.org/schema/integration http://www.springframework.org/schema/integration/spring-integration-2.0.xsd
|
||||
http://www.springframework.org/schema/integration/file http://www.springframework.org/schema/integration/file/spring-integration-file-2.0.xsd
|
||||
http://www.springframework.org/schema/task http://www.springframework.org/schema/task/spring-task-3.0.xsd"
|
||||
xmlns:int="http://www.springframework.org/schema/integration"
|
||||
xmlns:int-file="http://www.springframework.org/schema/integration/file"
|
||||
xmlns:task="http://www.springframework.org/schema/task">
|
||||
|
||||
|
||||
<int-file:inbound-channel-adapter id="filesInChannel"
|
||||
directory="file:input">
|
||||
<int:poller id="poller" fixed-rate="10" task-executor="executor"/>
|
||||
</int-file:inbound-channel-adapter>
|
||||
|
||||
<int:service-activator input-channel="filesInChannel" output-channel="filesOutChannel">
|
||||
<bean class="org.springframework.integration.samples.fileprocessing.FileProcessor"/>
|
||||
</int:service-activator>
|
||||
|
||||
<int:channel id="filesOutChannel">
|
||||
<int:queue/>
|
||||
</int:channel>
|
||||
|
||||
<task:executor id="executor" pool-size="10"/>
|
||||
</beans>
|
||||
@@ -0,0 +1,26 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<beans xmlns="http://www.springframework.org/schema/beans"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
|
||||
http://www.springframework.org/schema/integration http://www.springframework.org/schema/integration/spring-integration-2.0.xsd
|
||||
http://www.springframework.org/schema/integration/file http://www.springframework.org/schema/integration/file/spring-integration-file-2.0.xsd
|
||||
http://www.springframework.org/schema/task http://www.springframework.org/schema/task/spring-task-3.0.xsd"
|
||||
xmlns:int="http://www.springframework.org/schema/integration"
|
||||
xmlns:int-file="http://www.springframework.org/schema/integration/file"
|
||||
xmlns:task="http://www.springframework.org/schema/task">
|
||||
|
||||
|
||||
<int-file:inbound-channel-adapter id="filesInChannel"
|
||||
directory="file:input">
|
||||
<int:poller id="poller" fixed-rate="10"/>
|
||||
</int-file:inbound-channel-adapter>
|
||||
|
||||
<int:service-activator input-channel="filesInChannel" output-channel="filesOutChannel">
|
||||
<bean class="org.springframework.integration.samples.fileprocessing.FileProcessor"/>
|
||||
</int:service-activator>
|
||||
|
||||
<int:channel id="filesOutChannel">
|
||||
<int:queue/>
|
||||
</int:channel>
|
||||
|
||||
</beans>
|
||||
Reference in New Issue
Block a user