forked from spring-projects/spring-integration-samples
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
spring-projectsGH-234: Add TCP Broadcast Sample
Resolves spring-projects#234
- Loading branch information
1 parent
2a88598
commit 4423825
Showing
6 changed files
with
455 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -19,3 +19,5 @@ activemq-data | |
/.gradle | ||
build/ | ||
/classes | ||
.mvn | ||
mvnw* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
== TCP Sample | ||
|
||
This sample demonstrates broadcasting a message received by a web controller to all connected TCP clients. | ||
|
||
`curl -X POST http://localhost:8080/broadcast/foo` will send 'foo' to 5 connected clients. | ||
|
||
The TCP server listens on port 1234. | ||
|
||
|
||
`2018-11-19 12:01:48.546 INFO 98411 --- [ main] com.example.TcpBroadcastApplication : Started TcpBroadcastApplication in 1.904 seconds (JVM running for 2.345)` | ||
`connected! from client# 5` | ||
`connected! from client# 4` | ||
`connected! from client# 3` | ||
`connected! from client# 2` | ||
`connected! from client# 1` | ||
|
||
`curl -X POST http://localhost:8080/broadcast/foo` | ||
|
||
`foo from client# 4` | ||
`foo from client# 5` | ||
`foo from client# 2` | ||
`foo from client# 1` | ||
`foo from client# 3` | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,205 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<project xmlns="http://maven.apache.org/POM/4.0.0" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> | ||
<modelVersion>4.0.0</modelVersion> | ||
<parent> | ||
<groupId>org.springframework.boot</groupId> | ||
<artifactId>spring-boot-starter-parent</artifactId> | ||
<version>2.1.0.RELEASE</version> | ||
</parent> | ||
<groupId>org.springframework.integration.samples</groupId> | ||
<artifactId>tcp-broadcast</artifactId> | ||
<version>5.1.1.BUILD-SNAPSHOT</version> | ||
<name>TCP Client Broadcast Sample</name> | ||
<description>TCP Client Broadcast Sample</description> | ||
<url>http://projects.spring.io/spring-integration</url> | ||
<organization> | ||
<name>SpringIO</name> | ||
<url>https://spring.io</url> | ||
</organization> | ||
<licenses> | ||
<license> | ||
<name>The Apache Software License, Version 2.0</name> | ||
<url>http://www.apache.org/licenses/LICENSE-2.0.txt</url> | ||
<distribution>repo</distribution> | ||
</license> | ||
</licenses> | ||
<developers> | ||
<developer> | ||
<id>garyrussell</id> | ||
<name>Gary Russell</name> | ||
<email>grussell@pivotal.io</email> | ||
<roles> | ||
<role>project lead</role> | ||
</roles> | ||
</developer> | ||
<developer> | ||
<id>markfisher</id> | ||
<name>Mark Fisher</name> | ||
<email>mfisher@pivotal.io</email> | ||
<roles> | ||
<role>project founder and lead emeritus</role> | ||
</roles> | ||
</developer> | ||
<developer> | ||
<id>ghillert</id> | ||
<name>Gunnar Hillert</name> | ||
<email>ghillert@pivotal.io</email> | ||
</developer> | ||
<developer> | ||
<id>abilan</id> | ||
<name>Artem Bilan</name> | ||
<email>abilan@pivotal.io</email> | ||
</developer> | ||
</developers> | ||
<scm> | ||
<connection>scm:git:scm:git:git://github.com/spring-projects/spring-integration-samples.git</connection> | ||
<developerConnection>scm:git:scm:git:ssh://git@github.com:spring-projects/spring-integration-samples.git</developerConnection> | ||
<url>https://github.com/spring-projects/spring-integration-samples</url> | ||
</scm> | ||
<dependencies> | ||
<dependency> | ||
<groupId>org.springframework.boot</groupId> | ||
<artifactId>spring-boot-starter-web</artifactId> | ||
<scope>compile</scope> | ||
<exclusions> | ||
<exclusion> | ||
<artifactId>jackson-module-kotlin</artifactId> | ||
<groupId>com.fasterxml.jackson.module</groupId> | ||
</exclusion> | ||
</exclusions> | ||
</dependency> | ||
<dependency> | ||
<groupId>org.springframework.boot</groupId> | ||
<artifactId>spring-boot-starter-integration</artifactId> | ||
<scope>compile</scope> | ||
<exclusions> | ||
<exclusion> | ||
<artifactId>jackson-module-kotlin</artifactId> | ||
<groupId>com.fasterxml.jackson.module</groupId> | ||
</exclusion> | ||
</exclusions> | ||
</dependency> | ||
<dependency> | ||
<groupId>org.springframework.integration</groupId> | ||
<artifactId>spring-integration-ip</artifactId> | ||
<scope>compile</scope> | ||
<exclusions> | ||
<exclusion> | ||
<artifactId>jackson-module-kotlin</artifactId> | ||
<groupId>com.fasterxml.jackson.module</groupId> | ||
</exclusion> | ||
</exclusions> | ||
</dependency> | ||
<dependency> | ||
<groupId>junit</groupId> | ||
<artifactId>junit</artifactId> | ||
<version>4.12</version> | ||
<scope>test</scope> | ||
<exclusions> | ||
<exclusion> | ||
<artifactId>jackson-module-kotlin</artifactId> | ||
<groupId>com.fasterxml.jackson.module</groupId> | ||
</exclusion> | ||
<exclusion> | ||
<artifactId>*</artifactId> | ||
<groupId>org.hamcrest</groupId> | ||
</exclusion> | ||
</exclusions> | ||
</dependency> | ||
<dependency> | ||
<groupId>org.hamcrest</groupId> | ||
<artifactId>hamcrest-all</artifactId> | ||
<version>1.3</version> | ||
<scope>test</scope> | ||
<exclusions> | ||
<exclusion> | ||
<artifactId>jackson-module-kotlin</artifactId> | ||
<groupId>com.fasterxml.jackson.module</groupId> | ||
</exclusion> | ||
</exclusions> | ||
</dependency> | ||
<dependency> | ||
<groupId>org.mockito</groupId> | ||
<artifactId>mockito-core</artifactId> | ||
<version>2.18.0</version> | ||
<scope>test</scope> | ||
<exclusions> | ||
<exclusion> | ||
<artifactId>jackson-module-kotlin</artifactId> | ||
<groupId>com.fasterxml.jackson.module</groupId> | ||
</exclusion> | ||
<exclusion> | ||
<artifactId>*</artifactId> | ||
<groupId>org.hamcrest</groupId> | ||
</exclusion> | ||
</exclusions> | ||
</dependency> | ||
<dependency> | ||
<groupId>org.springframework</groupId> | ||
<artifactId>spring-test</artifactId> | ||
<scope>test</scope> | ||
<exclusions> | ||
<exclusion> | ||
<artifactId>jackson-module-kotlin</artifactId> | ||
<groupId>com.fasterxml.jackson.module</groupId> | ||
</exclusion> | ||
</exclusions> | ||
</dependency> | ||
<dependency> | ||
<groupId>org.springframework.boot</groupId> | ||
<artifactId>spring-boot-starter-test</artifactId> | ||
<scope>test</scope> | ||
<exclusions> | ||
<exclusion> | ||
<artifactId>jackson-module-kotlin</artifactId> | ||
<groupId>com.fasterxml.jackson.module</groupId> | ||
</exclusion> | ||
</exclusions> | ||
</dependency> | ||
</dependencies> | ||
<repositories> | ||
<repository> | ||
<id>repo.spring.io.milestone</id> | ||
<name>Spring Framework Maven Milestone Repository</name> | ||
<url>https://repo.spring.io/libs-milestone</url> | ||
</repository> | ||
<repository> | ||
<id>repo.spring.io.snapshot</id> | ||
<name>Spring Framework Maven Snapshot Repository</name> | ||
<url>https://repo.spring.io/libs-snapshot</url> | ||
</repository> | ||
</repositories> | ||
<build> | ||
<plugins> | ||
<plugin> | ||
<groupId>org.springframework.boot</groupId> | ||
<artifactId>spring-boot-maven-plugin</artifactId> | ||
</plugin> | ||
</plugins> | ||
</build> | ||
<dependencyManagement> | ||
<dependencies> | ||
<dependency> | ||
<groupId>org.springframework.boot</groupId> | ||
<artifactId>spring-boot-dependencies</artifactId> | ||
<version>2.1.0.RELEASE</version> | ||
<scope>import</scope> | ||
<type>pom</type> | ||
</dependency> | ||
<dependency> | ||
<groupId>org.springframework</groupId> | ||
<artifactId>spring-framework-bom</artifactId> | ||
<version>5.1.2.RELEASE</version> | ||
<scope>import</scope> | ||
<type>pom</type> | ||
</dependency> | ||
<dependency> | ||
<groupId>org.springframework.integration</groupId> | ||
<artifactId>spring-integration-bom</artifactId> | ||
<version>5.1.0.RELEASE</version> | ||
<scope>import</scope> | ||
<type>pom</type> | ||
</dependency> | ||
</dependencies> | ||
</dependencyManagement> | ||
</project> |
Oops, something went wrong.