Skip to content

Commit 534d68a

Browse files
author
Artem Pronchakov
committed
Add Spring Integration Router sample
1 parent c4452db commit 534d68a

11 files changed

Lines changed: 145 additions & 0 deletions

File tree

.idea/compiler.xml

Lines changed: 2 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/encodings.xml

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/modules.xml

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Spring/Integration/pom.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
<module></module>
1414
<module>spring-integration-01</module>
1515
<module>spring-integration-02</module>
16+
<module>spring-integration-03</module>
1617
</modules>
1718

1819
</project>
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
2+
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
3+
<modelVersion>4.0.0</modelVersion>
4+
5+
<parent>
6+
<groupId>edu.javacourse</groupId>
7+
<artifactId>examples</artifactId>
8+
<version>1.0-SNAPSHOT</version>
9+
<relativePath>../../../</relativePath>
10+
</parent>
11+
12+
<groupId>edu.javacourse.spring</groupId>
13+
<artifactId>spring-integration-03</artifactId>
14+
<version>1.0-SNAPSHOT</version>
15+
<packaging>jar</packaging>
16+
17+
<name>Spring Integration 03</name>
18+
19+
<dependencies>
20+
21+
<dependency>
22+
<groupId>org.springframework.integration</groupId>
23+
<artifactId>spring-integration-core</artifactId>
24+
</dependency>
25+
</dependencies>
26+
27+
</project>
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Router
Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<module org.jetbrains.idea.maven.project.MavenProjectsManager.isMavenModule="true" type="JAVA_MODULE" version="4">
3+
<component name="FacetManager">
4+
<facet type="Spring" name="Spring">
5+
<configuration>
6+
<fileset id="fileset" name="Spring Application Context" removed="false">
7+
<file>file://$MODULE_DIR$/src/main/resources/spring-context.xml</file>
8+
</fileset>
9+
</configuration>
10+
</facet>
11+
</component>
12+
<component name="NewModuleRootManager" LANGUAGE_LEVEL="JDK_1_7" inherit-compiler-output="false">
13+
<output url="file://$MODULE_DIR$/target/classes" />
14+
<output-test url="file://$MODULE_DIR$/target/test-classes" />
15+
<content url="file://$MODULE_DIR$">
16+
<sourceFolder url="file://$MODULE_DIR$/src/main/java" isTestSource="false" />
17+
<sourceFolder url="file://$MODULE_DIR$/src/main/resources" type="java-resource" />
18+
<excludeFolder url="file://$MODULE_DIR$/target" />
19+
</content>
20+
<orderEntry type="inheritedJdk" />
21+
<orderEntry type="sourceFolder" forTests="false" />
22+
<orderEntry type="library" name="Maven: org.springframework.integration:spring-integration-core:4.1.0.RELEASE" level="project" />
23+
<orderEntry type="library" name="Maven: org.springframework:spring-context:4.1.1.RELEASE" level="project" />
24+
<orderEntry type="library" name="Maven: org.springframework:spring-beans:4.1.1.RELEASE" level="project" />
25+
<orderEntry type="library" name="Maven: org.springframework:spring-core:4.1.1.RELEASE" level="project" />
26+
<orderEntry type="library" name="Maven: commons-logging:commons-logging:1.1.3" level="project" />
27+
<orderEntry type="library" name="Maven: org.springframework:spring-expression:4.1.1.RELEASE" level="project" />
28+
<orderEntry type="library" name="Maven: org.projectreactor:reactor-core:1.1.4.RELEASE" level="project" />
29+
<orderEntry type="library" name="Maven: com.goldmansachs:gs-collections:5.1.0" level="project" />
30+
<orderEntry type="library" name="Maven: com.goldmansachs:gs-collections-api:5.1.0" level="project" />
31+
<orderEntry type="library" name="Maven: com.lmax:disruptor:3.2.1" level="project" />
32+
<orderEntry type="library" name="Maven: io.gatling:jsr166e:1.0" level="project" />
33+
<orderEntry type="library" name="Maven: org.slf4j:slf4j-api:1.7.7" level="project" />
34+
<orderEntry type="library" name="Maven: org.springframework:spring-messaging:4.1.2.RELEASE" level="project" />
35+
<orderEntry type="library" name="Maven: org.springframework.retry:spring-retry:1.1.1.RELEASE" level="project" />
36+
<orderEntry type="library" name="Maven: org.springframework:spring-aop:4.1.1.RELEASE" level="project" />
37+
<orderEntry type="library" name="Maven: aopalliance:aopalliance:1.0" level="project" />
38+
<orderEntry type="library" name="Maven: org.springframework:spring-tx:4.1.1.RELEASE" level="project" />
39+
</component>
40+
</module>
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
package edu.javacourse.spring.integration;
2+
3+
/**
4+
* @author Artem Pronchakov | email/xmpp: artem.pronchakov@calisto.email
5+
*/
6+
public class BigLogger {
7+
8+
public void log(String message){
9+
System.out.println("BigLogger: " + message);
10+
}
11+
12+
}
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
package edu.javacourse.spring.integration;
2+
3+
import org.springframework.context.ApplicationContext;
4+
import org.springframework.context.support.ClassPathXmlApplicationContext;
5+
import org.springframework.messaging.MessageChannel;
6+
import org.springframework.messaging.support.GenericMessage;
7+
8+
/**
9+
* @author Artem Pronchakov | email/xmpp: artem.pronchakov@calisto.email
10+
*/
11+
public class Main {
12+
13+
public static void main(String[] args) {
14+
ApplicationContext context = new ClassPathXmlApplicationContext("spring-context.xml");
15+
MessageChannel transformationChannel = context.getBean("routeChannel", MessageChannel.class);
16+
17+
transformationChannel.send(new GenericMessage<String>("hello"));
18+
transformationChannel.send(new GenericMessage<String>("world"));
19+
transformationChannel.send(new GenericMessage<String>("Big String"));
20+
transformationChannel.send(new GenericMessage<String>("Small"));
21+
transformationChannel.send(new GenericMessage<String>("Very Big String"));
22+
}
23+
24+
}
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
package edu.javacourse.spring.integration;
2+
3+
/**
4+
* @author Artem Pronchakov | email/xmpp: artem.pronchakov@calisto.email
5+
*/
6+
public class SmallLogger {
7+
8+
public void log(String message){
9+
System.out.println("SmallLogger: " + message);
10+
}
11+
12+
}

0 commit comments

Comments
 (0)