BAEL-80 - spring integration

(cherry picked from commit ce66553)
This commit is contained in:
slavisa-baeldung 2016-10-18 07:11:20 +02:00
parent 9b0cfbafbf
commit 66b6ce3dbe
7 changed files with 144 additions and 13 deletions

21
pom.xml
View File

@ -17,22 +17,22 @@
<module>assertj</module> <module>assertj</module>
<module>apache-cxf</module> <module>apache-cxf</module>
<!-- <module>apache-fop</module> --> <!-- TODO: has a compilation issue --> <!-- <module>apache-fop</module> --> <!-- TODO: has a compilation issue -->
<module>autovalue</module> <module>autovalue-tutorial</module>
<module>cdi</module> <module>cdi</module>
<module>core-java</module> <module>core-java</module>
<module>core-java-8</module>
<module>couchbase-sdk</module> <module>couchbase-sdk</module>
<!-- <module>core-java-9</module> --> <!-- <module>core-java-9</module> -->
<module>dozer</module> <module>dozer</module>
<module>dependency-injection</module>
<module>deltaspike</module> <module>deltaspike</module>
<module>patterns</module> <module>patterns</module>
<module>feign</module> <module>feign-client</module>
<!-- <module>gatling</module> --> <!-- not meant to run as part of the standard build --> <!-- <module>gatling</module> --> <!-- not meant to run as part of the standard build -->
<module>flyway</module>
<module>gson</module> <module>gson</module>
<module>guava</module> <module>guava</module>
<module>guava18</module> <module>guava18</module>
@ -46,12 +46,12 @@
<module>jackson</module> <module>jackson</module>
<module>javaxval</module> <module>javaxval</module>
<module>jjwt</module> <module>jjwt</module>
<module>jooq-spring</module>
<module>jpa-storedprocedure</module> <module>jpa-storedprocedure</module>
<module>json</module> <module>json</module>
<module>json-path</module> <module>json-path</module>
<module>junit5</module> <module>junit5</module>
<module>jee7</module> <module>jee7schedule</module>
<!-- <module>jpa-storedprocedure</module> --> <!-- <module>jpa-storedprocedure</module> -->
<module>log4j</module> <module>log4j</module>
@ -68,6 +68,7 @@
<module>rest-assured</module> <module>rest-assured</module>
<module>rest-testing</module> <module>rest-testing</module>
<module>resteasy</module> <module>resteasy</module>
<module>okhttp</module>
<module>spring-all</module> <module>spring-all</module>
<module>spring-akka</module> <module>spring-akka</module>
@ -75,7 +76,6 @@
<module>spring-autowire</module> <module>spring-autowire</module>
<module>spring-batch</module> <module>spring-batch</module>
<module>spring-boot</module> <module>spring-boot</module>
<module>spring-core</module>
<module>spring-cucumber</module> <module>spring-cucumber</module>
<module>spring-data-cassandra</module> <module>spring-data-cassandra</module>
<module>spring-data-couchbase-2</module> <module>spring-data-couchbase-2</module>
@ -84,14 +84,13 @@
<module>spring-data-mongodb</module> <module>spring-data-mongodb</module>
<module>spring-data-redis</module> <module>spring-data-redis</module>
<module>spring-data-rest</module> <module>spring-data-rest</module>
<!--<module>spring-dispatcher-servlet</module>-->
<module>spring-exceptions</module> <module>spring-exceptions</module>
<module>spring-freemarker</module> <module>spring-freemarker</module>
<module>spring-hibernate3</module> <module>spring-hibernate3</module>
<module>spring-hibernate4</module> <module>spring-hibernate4</module>
<module>spring-jms</module> <module>spring-integration</module>
<module>spring-jooq</module>
<module>spring-jpa</module> <module>spring-jpa</module>
<module>spring-jms</module>
<module>spring-katharsis</module> <module>spring-katharsis</module>
<module>spring-mockito</module> <module>spring-mockito</module>
<module>spring-mvc-java</module> <module>spring-mvc-java</module>
@ -110,7 +109,6 @@
<module>spring-security-basic-auth</module> <module>spring-security-basic-auth</module>
<module>spring-security-custom-permission</module> <module>spring-security-custom-permission</module>
<module>spring-security-custom-voter</module>
<module>spring-security-mvc-custom</module> <module>spring-security-mvc-custom</module>
<module>spring-security-mvc-digest-auth</module> <module>spring-security-mvc-digest-auth</module>
<module>spring-security-mvc-ldap</module> <module>spring-security-mvc-ldap</module>
@ -129,7 +127,6 @@
<module>jsf</module> <module>jsf</module>
<module>xml</module> <module>xml</module>
<module>xmlunit2</module>
<module>lombok</module> <module>lombok</module>
<module>redis</module> <module>redis</module>

View File

@ -0,0 +1,43 @@
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:int="http://www.springframework.org/schema/integration"
xmlns:file="http://www.springframework.org/schema/integration/file"
xmlns:ftp="http://www.springframework.org/schema/integration/ftp"
xmlns:mail="http://www.springframework.org/schema/integration/mail"
xmlns:twitter="http://www.springframework.org/schema/integration/twitter"
xsi:schemaLocation="http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans.xsd
http://www.springframework.org/schema/integration
http://www.springframework.org/schema/integration/spring-integration.xsd
http://www.springframework.org/schema/integration/file
http://www.springframework.org/schema/integration/file/spring-integration-file.xsd
http://www.springframework.org/schema/integration/ftp
http://www.springframework.org/schema/integration/ftp/spring-integration-ftp.xsd
http://www.springframework.org/schema/integration/mail
http://www.springframework.org/schema/integration/mail/spring-integration-mail.xsd
http://www.springframework.org/schema/integration/twitter
http://www.springframework.org/schema/integration/twitter/spring-integration-twitter.xsd">
<file:inbound-channel-adapter id="videoFolder"
directory="C:\projects\baeldung\clean-start-tutorials\tutorials\spring-integration\src\main\resources\source"
channel="videoChannel"
prevent-duplicates="true">
<int:poller fixed-rate="1000"/>
</file:inbound-channel-adapter>
<file:outbound-channel-adapter id="destFileFolder"
directory="C:\projects\baeldung\clean-start-tutorials\tutorials\spring-integration\src\main\resources\destination"
channel="videoChannel"
>
</file:outbound-channel-adapter>
<int:channel id="videoChannel"/>
<!-- <int:service-activator input-channel="videoChannel" output-channel="destFileFolder" method="handleMessage"
ref="customActivator"/>
<bean name="customActivator" class="com.baeldung.samples.endpoints.ActivatorImpl"/>-->
</beans>

View File

@ -0,0 +1,43 @@
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:int="http://www.springframework.org/schema/integration"
xmlns:file="http://www.springframework.org/schema/integration/file"
xmlns:ftp="http://www.springframework.org/schema/integration/ftp"
xmlns:mail="http://www.springframework.org/schema/integration/mail"
xmlns:twitter="http://www.springframework.org/schema/integration/twitter"
xsi:schemaLocation="http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans.xsd
http://www.springframework.org/schema/integration
http://www.springframework.org/schema/integration/spring-integration.xsd
http://www.springframework.org/schema/integration/file
http://www.springframework.org/schema/integration/file/spring-integration-file.xsd
http://www.springframework.org/schema/integration/ftp
http://www.springframework.org/schema/integration/ftp/spring-integration-ftp.xsd
http://www.springframework.org/schema/integration/mail
http://www.springframework.org/schema/integration/mail/spring-integration-mail.xsd
http://www.springframework.org/schema/integration/twitter
http://www.springframework.org/schema/integration/twitter/spring-integration-twitter.xsd">
<file:inbound-channel-adapter id="videoFolder"
directory="C:\projects\baeldung\clean-start-tutorials\tutorials\spring-integration\src\main\resources\source"
channel="videoChannel"
prevent-duplicates="true">
<int:poller fixed-rate="1000"/>
</file:inbound-channel-adapter>
<file:outbound-channel-adapter id="destFileFolder"
directory="C:\projects\baeldung\clean-start-tutorials\tutorials\spring-integration\src\main\resources\destination"
channel="videoChannel"
>
</file:outbound-channel-adapter>
<int:channel id="videoChannel"/>
<!-- <int:service-activator input-channel="videoChannel" output-channel="destFileFolder" method="handleMessage"
ref="customActivator"/>
<bean name="customActivator" class="com.baeldung.samples.endpoints.ActivatorImpl"/>-->
</beans>

Binary file not shown.

After

Width:  |  Height:  |  Size: 760 KiB

View File

@ -0,0 +1,48 @@
/*
* Copyright 2002-2013 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.baeldung.samples;
import org.apache.log4j.Logger;
import org.junit.Test;
import org.springframework.context.support.AbstractApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;
import java.util.Scanner;
/**
* Starts the Spring Context and will initialize the Spring Integration routes.
*
* @author Baeldung
* @since 1.0
*
*/
public final class FileCopyTest {
private static final Logger LOGGER = Logger.getLogger(FileCopyTest.class);
@Test
public void test() throws InterruptedException {
final AbstractApplicationContext context =
new ClassPathXmlApplicationContext("classpath:META-INF/spring/integration/spring-integration-file-copy-context.xml");
Thread.sleep(5000);
}
}