--------------------------------------------------------------------------------
/basic/xml/src/main/resources/META-INF/spring/integration/bigBooksSupplierTransformer.xsl:
--------------------------------------------------------------------------------
1 |
2 |
6 |
7 |
8 |
9 | smallbooks
10 | 5
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
--------------------------------------------------------------------------------
/basic/web-sockets/src/main/resources/logback.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
6 |
7 | %d{HH:mm:ss.SSS} [%thread] %-5level %logger{36} - %msg%n
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
--------------------------------------------------------------------------------
/applications/cafe-scripted/src/main/resources/log4j2.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
--------------------------------------------------------------------------------
/applications/cafe/cafe-si/src/main/resources/log4j2.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
--------------------------------------------------------------------------------
/basic/zip/src/main/resources/log4j2.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
--------------------------------------------------------------------------------
/applications/README.md:
--------------------------------------------------------------------------------
1 | Applications Samples
2 | ====================
3 |
4 | This category targets developers and architects who have a good understanding of the Messaging architecture, EIP and above average understanding of Spring and Spring integration and are looking for samples that address a particular business problem. In other word the emphasis of samples in this category is 'business use cases' and how it could be solved via Messaging architecture and Spring Integration in particular. For example; If you are interested to see how a Loan Broker process or Travel Agent process could be implemented and automated via Spring Integration this would be the right place to find these types of samples.
5 |
6 |
--------------------------------------------------------------------------------
/applications/cafe/cafe-amqp/src/main/resources/log4j2.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
--------------------------------------------------------------------------------
/applications/cafe/cafe-jms/src/main/resources/log4j2.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
--------------------------------------------------------------------------------
/applications/loan-broker/src/main/resources/META-INF/spring/integration/bootstrap-config/stubbed-loan-broker-multicast.xml:
--------------------------------------------------------------------------------
1 |
2 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
--------------------------------------------------------------------------------
/applications/loanshark/README.md:
--------------------------------------------------------------------------------
1 | Loan Shark Application
2 | ======================
3 |
4 | See **README.txt** in the **loan-broker sample** for information about this sample.
5 |
6 | To change the multicast code in **udps.groovy** to rely on unicast instead, simply change the *MulticastSocket* type to *DatagramSocket* and remove the next 2 lines that deal with joining the multicast group. Then, in the configuration of the actual adapter, set:
7 |
8 | host="127.0.0.1" and multicast="false".
9 |
10 | For the Roo/Spring Integration application:
11 |
12 | * Edit the **integrationContext.xml** file
13 | * On the udpIn adapter, set **multicast** to false and
14 | * Remove the **multicast-address** attribute.
--------------------------------------------------------------------------------
/basic/barrier/src/main/resources/logback.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
6 |
7 | %d{HH:mm:ss.SSS} [%thread] %-5level %logger{36} - %msg%n
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
--------------------------------------------------------------------------------
/basic/tcp-with-headers/src/main/resources/logback.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
6 |
7 | %d{HH:mm:ss.SSS} [%thread] %-5level %logger{36} - %msg%n
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
--------------------------------------------------------------------------------
/basic/xml/src/main/resources/log4j2.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
--------------------------------------------------------------------------------
/basic/xmpp/src/test/resources/log4j2.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
--------------------------------------------------------------------------------
/dsl/kafka-dsl/src/main/resources/application.yml:
--------------------------------------------------------------------------------
1 | kafka:
2 | topic: si.topic
3 | newTopic: si.new.topic
4 | messageKey: si.key
5 | spring:
6 | kafka:
7 | consumer:
8 | group-id: siTestGroup
9 | auto-offset-reset: earliest
10 | enable-auto-commit: false
11 | value-deserializer: org.apache.kafka.common.serialization.StringDeserializer
12 | key-deserializer: org.apache.kafka.common.serialization.StringDeserializer
13 | producer:
14 | batch-size: 16384
15 | buffer-memory: 33554432
16 | retries: 0
17 | key-serializer: org.apache.kafka.common.serialization.StringSerializer
18 | value-serializer: org.apache.kafka.common.serialization.StringSerializer
19 |
--------------------------------------------------------------------------------
/basic/ws-inbound-gateway/src/test/resources/log4j2.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
--------------------------------------------------------------------------------
/intermediate/tx-synch/src/main/resources/log4j2.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
--------------------------------------------------------------------------------
/basic/amqp/src/main/resources/log4j2.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
--------------------------------------------------------------------------------
/basic/kafka/src/main/resources/application.yml:
--------------------------------------------------------------------------------
1 | kafka:
2 | topic: si.topic
3 | newTopic: si.new.topic
4 | messageKey: si.key
5 | spring:
6 | kafka:
7 | consumer:
8 | group-id: siTestGroup
9 | auto-offset-reset: earliest
10 | enable-auto-commit: false
11 | value-deserializer: org.apache.kafka.common.serialization.StringDeserializer
12 | key-deserializer: org.apache.kafka.common.serialization.StringDeserializer
13 | producer:
14 | batch-size: 16384
15 | buffer-memory: 33554432
16 | retries: 0
17 | key-serializer: org.apache.kafka.common.serialization.StringSerializer
18 | value-serializer: org.apache.kafka.common.serialization.StringSerializer
19 |
20 |
21 |
--------------------------------------------------------------------------------
/intermediate/retry-and-more/src/main/resources/log4j2.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
--------------------------------------------------------------------------------
/basic/README.md:
--------------------------------------------------------------------------------
1 | Basic Samples
2 | =============
3 |
4 | This is a good place to get started. The samples here are technically motivated and demonstrate the bare minimum with regard to configuration and code to help you to get introduced to the basic concepts, API and configuration of [Spring Integration](https://www.springsource.org/spring-integration) and how they relate to [Enterprise Integration Patterns](https://www.enterpriseintegrationpatterns.com/) (EIP).
5 |
6 | For example; if your are looking for an answer on how to wire a **Service Activator** to a **Channel** or how to apply a **Gateway** to your message exchange or how to get started with using the **Mail** or **XML** module etc., this would be the right place to find a good sample.
--------------------------------------------------------------------------------
/basic/ws-inbound-gateway/src/main/webapp/WEB-INF/spring-ws-config.xml:
--------------------------------------------------------------------------------
1 |
2 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
--------------------------------------------------------------------------------
/applications/loanshark/src/main/webapp/WEB-INF/views/loansharks/findLoanSharksByName.jspx:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/applications/loanshark/script.roo:
--------------------------------------------------------------------------------
1 | project --topLevelPackage org.springframework.samples.integration.loanbroker.loanshark3
2 | persistence setup --provider HIBERNATE --database HYPERSONIC_IN_MEMORY
3 | entity --class ~.domain.LoanShark
4 | field string --fieldName name
5 | field number --type java.lang.Long --fieldName counter
6 | field number --type java.lang.Double --fieldName averageRate
7 | finder add --finderName findLoanSharksByName
8 | controller scaffold --class ~.web.SharkController
9 | logging setup --level DEBUG
10 | dependency add --artifactId org.springframework.integration.ip --groupId org.springframework.integration --version 2.0.0.M5
11 | //change spring version in pom.xml to 3.0.0.RELEASE-A before perform eclipse
12 | //perform eclipse
13 |
--------------------------------------------------------------------------------
/basic/mqtt/src/main/resources/logback.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
6 |
7 | %d{HH:mm:ss.SSS} [%thread] %-5level %logger{36} - %msg%n
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
--------------------------------------------------------------------------------
/basic/ws-outbound-gateway/src/main/resources/log4j2.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
--------------------------------------------------------------------------------
/dsl/cafe-dsl/README.md:
--------------------------------------------------------------------------------
1 | # Cafe Demo: Spring Integration Java DSL
2 |
3 | This sample demonstrates the classical Cafe Demo, but it is based on [Spring Integration Java DSL](https://github.com/spring-projects/spring-integration-extensions/wiki/Spring-Integration-Java-DSL-Reference)
4 | and [Spring Boot](https://projects.spring.io/spring-boot).
5 |
6 | See the `cafe` project **README.md** for more details about the domain and the Cafe algorithm.
7 |
8 | ## Run the Sample
9 |
10 | * You need Java 8 to run this sample, because it is based on Lambdas.
11 | * running the `org.springframework.integration.samples.dsl.cafe.lambda.Application` class from within STS (Right-click on
12 | Main class --> Run As --> Java Application)
13 | * or from the command line:
14 |
15 | $ gradlew :cafe-dsl:bootRun
16 |
--------------------------------------------------------------------------------
/intermediate/splitter-aggregator-reaper/src/main/resources/log4j2.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
--------------------------------------------------------------------------------
/src/checkstyle/checkstyle-header.txt:
--------------------------------------------------------------------------------
1 | ^\Q/*\E$
2 | ^\Q * Copyright \E20\d\d\Q-present the original author or authors.\E$
3 | ^\Q *\E$
4 | ^\Q * Licensed under the Apache License, Version 2.0 (the "License");\E$
5 | ^\Q * you may not use this file except in compliance with the License.\E$
6 | ^\Q * You may obtain a copy of the License at\E$
7 | ^\Q *\E$
8 | ^\Q * https://www.apache.org/licenses/LICENSE-2.0\E$
9 | ^\Q *\E$
10 | ^\Q * Unless required by applicable law or agreed to in writing, software\E$
11 | ^\Q * distributed under the License is distributed on an "AS IS" BASIS,\E$
12 | ^\Q * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\E$
13 | ^\Q * See the License for the specific language governing permissions and\E$
14 | ^\Q * limitations under the License.\E$
15 | ^\Q */\E$
16 | ^$
17 | ^.*$
18 |
--------------------------------------------------------------------------------
/.github/workflows/ci-snapshot.yml:
--------------------------------------------------------------------------------
1 | name: CI SNAPSHOT
2 |
3 | on:
4 | workflow_dispatch:
5 |
6 | push:
7 | branches:
8 | - main
9 |
10 | schedule:
11 | - cron: '0 5 * * *'
12 |
13 | concurrency:
14 | group: group-snapshot-for-${{ github.ref }}
15 | cancel-in-progress: true
16 |
17 | env:
18 | DEVELOCITY_ACCESS_KEY: ${{ secrets.DEVELOCITY_ACCESS_KEY }}
19 |
20 | jobs:
21 | build_snapshot:
22 | runs-on: ubuntu-latest
23 | name: CI Build SNAPSHOT for ${{ github.ref_name }}
24 | steps:
25 |
26 | - uses: actions/checkout@v5
27 | with:
28 | show-progress: false
29 |
30 | - name: Set up Gradle
31 | uses: spring-io/spring-gradle-build-action@v2
32 | with:
33 | java-version: 25
34 |
35 | - name: Build
36 | run: ./gradlew check
37 |
38 |
--------------------------------------------------------------------------------
/intermediate/README.md:
--------------------------------------------------------------------------------
1 | Intermediate Samples
2 | ====================
3 |
4 | This category targets developers who are already familiar with the [Spring Integration](https://www.springsource.org/spring-integration) framework (past getting started), but need some more guidance while resolving more advanced technical problems that they have to deal with once having switched to a Messaging architecture.
5 |
6 | For example; If you are looking for an answer on how to handle errors in various scenarios or how to properly configure the **Aggregator** for the situations where some messages might not ever arrive for aggregation etc., and any other issue that goes beyond a basic understanding and configuration of a particular component and addresses "what else you can do with it" type of problem, this would be the right place to find these type of samples.
7 |
--------------------------------------------------------------------------------
/basic/control-bus/README.md:
--------------------------------------------------------------------------------
1 | Control Bus Sample
2 | ==================
3 |
4 | This example demonstrates the functionality of the Control Bus component available with Spring Integration. The Control Bus uses SpEL to send a Control Message to start/stop an inbound adapter. To run the Control Bus sample simply execute **ControlBusDemoTest** in the **org.springframework.integration.samples.controlbus** package.
5 |
6 | You will see output similar to this:
7 |
8 | INFO : org.springframework.integration.samples.jmx.ControlBusDemo - Received before adapter started: null
9 | INFO : org.springframework.integration.samples.jmx.ControlBusDemo - Received before adapter started: [Payload=Hello][Headers={timestamp=1294950897714, id=240e72fb-93b0-4d38-8fe8-b701cf7e9a5d}]
10 | INFO : org.springframework.integration.samples.jmx.ControlBusDemo - Received after adapter stopped: null
11 |
12 |
--------------------------------------------------------------------------------
/advanced/advanced-testing-examples/README.md:
--------------------------------------------------------------------------------
1 | Advanced Testing Examples
2 | =========================
3 |
4 | Example test cases that show advanced techniques to test Spring Integration based applications.
5 |
6 | For basic testing examples see: **basic/testing-examples**
7 |
8 | ## Examples
9 |
10 | **jms.JmsMockTests.java**
11 |
12 | This test case shows how to test an integration flow that uses JMS inbound channel adapter by using **Mockito** to mock a *JmsTemplate* (and dependent JMS objects). The example flow in **src/main/resources/integration-config.xml** does not depend on JMS but includes some additional error handling on **errorChannel**. The **errorChannel** is configured on the JMS adapter. So we want test the entire flow for cases in which an invalid message is received via JMS and routed to **errorChannel**. How do we do this without requiring a JMS message broker?
--------------------------------------------------------------------------------
/intermediate/rest-http/src/main/webapp/WEB-INF/config/web-application-config.xml:
--------------------------------------------------------------------------------
1 |
2 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
--------------------------------------------------------------------------------
/applications/file-split-ftp/README.adoc:
--------------------------------------------------------------------------------
1 | :imagesdir: ./images
2 |
3 | = File Split and FTP Sample
4 |
5 | - Looks for files `*.txt` in `/tmp/in`
6 | - Reads file and writes to 3 files based on account (first 4 bytes in file)
7 | - FileSplitter -> router [lines -> `lines`], [file marks -> `marks`]
8 | - `marks` filters on EOF marker (drops SOF)
9 | - pubsub [flush files], [ftp (x3)], [email result]
10 | - Exceptions go to `tfrErrors` - sends failure email
11 | - input file is renamed, based on final disposition
12 |
13 | Test cases are provided for happy path and failure scenarios
14 |
15 | Run `ApplicationTests` as a JUnit test from your IDE.
16 |
17 | = Flow Visualization
18 |
19 | This visualization is generated by the https://github.com/spring-projects/spring-flo/[Spring Integration Flow Viewer] which is currently under development.
20 |
21 | image::flo1.png[]
22 |
23 | image::flo2.png[]
24 |
--------------------------------------------------------------------------------
/applications/loanshark/src/main/webapp/WEB-INF/layouts/layouts.xml:
--------------------------------------------------------------------------------
1 |
2 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
--------------------------------------------------------------------------------
/basic/testing-examples/src/test/java/org/springframework/integration/samples/testing/chain/SpelChainTests-context.xml:
--------------------------------------------------------------------------------
1 |
2 |
9 |
10 |
11 |
12 |
14 |
15 |
16 |
17 |
18 |
19 |
--------------------------------------------------------------------------------
/basic/testing-examples/src/test/java/org/springframework/integration/samples/testing/gateway/GatewayTests-context.xml:
--------------------------------------------------------------------------------
1 |
2 |
9 |
10 |
11 |
12 |
14 |
15 |
16 |
17 |
18 |
19 |
--------------------------------------------------------------------------------
/basic/testing-examples/src/test/java/org/springframework/integration/samples/testing/splitter/CommaDelimitedSplitterTests-context.xml:
--------------------------------------------------------------------------------
1 |
2 |
9 |
10 |
11 |
12 |
14 |
15 |
16 |
17 |
18 |
19 |
--------------------------------------------------------------------------------
/basic/testing-examples/src/main/resources/META-INF/spring/integration/02-splitter/integration-context.xml:
--------------------------------------------------------------------------------
1 |
2 |
9 |
10 |
11 |
12 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
--------------------------------------------------------------------------------
/basic/testing-examples/src/test/java/org/springframework/integration/samples/testing/aggregator/CommaDelimitedAggregatorTests-context.xml:
--------------------------------------------------------------------------------
1 |
2 |
9 |
10 |
11 |
12 |
14 |
15 |
16 |
17 |
18 |
19 |
--------------------------------------------------------------------------------
/applications/loanshark/src/main/webapp/WEB-INF/tags/menu/menu.tagx:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
--------------------------------------------------------------------------------
/basic/tcp-broadcast/README.adoc:
--------------------------------------------------------------------------------
1 | == TCP Broadcast Sample
2 |
3 | This sample demonstrates broadcasting a message received by a web controller to all connected TCP clients.
4 |
5 | `curl -X POST http://localhost:8080/broadcast/foo` will send 'foo' to 5 connected clients.
6 |
7 | The TCP server listens on port 1234.
8 |
9 |
10 | `2018-11-19 12:01:48.546 INFO 98411 --- [ main] com.example.TcpBroadcastApplication : Started TcpBroadcastApplication in 1.904 seconds (JVM running for 2.345)`
11 | `connected! from client# 5`
12 | `connected! from client# 4`
13 | `connected! from client# 3`
14 | `connected! from client# 2`
15 | `connected! from client# 1`
16 |
17 | `curl -X POST http://localhost:8080/broadcast/foo`
18 |
19 | `foo from client# 4`
20 | `foo from client# 5`
21 | `foo from client# 2`
22 | `foo from client# 1`
23 | `foo from client# 3`
24 |
25 | To shut down the application:
26 |
27 | `curl http://localhost:8080/shutdown`
28 |
--------------------------------------------------------------------------------
/intermediate/stored-procedures-postgresql/src/main/resources/log4j.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
--------------------------------------------------------------------------------
/basic/http/src/main/webapp/WEB-INF/web.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | multipart-http
4 |
5 | Multipart
6 | org.springframework.web.servlet.DispatcherServlet
7 |
8 | contextConfigLocation
9 | /WEB-INF/servlet-config.xml
10 |
11 | 1
12 |
13 |
14 | Multipart
15 | /*
16 |
17 |
--------------------------------------------------------------------------------
/basic/testing-examples/src/main/resources/META-INF/spring/integration/05-router/integration-context.xml:
--------------------------------------------------------------------------------
1 |
2 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
--------------------------------------------------------------------------------
/settings.gradle:
--------------------------------------------------------------------------------
1 | pluginManagement {
2 | repositories {
3 | gradlePluginPortal()
4 | mavenCentral()
5 | maven { url = 'https://repo.spring.io/milestone' }
6 | maven { url = 'https://repo.spring.io/snapshot' }
7 | }
8 | }
9 |
10 | plugins {
11 | id 'io.spring.develocity.conventions' version '0.0.21'
12 | }
13 |
14 | rootProject.name = 'spring-integration-samples'
15 |
16 | ['advanced', 'applications', 'basic', 'intermediate', 'dsl'].each {
17 | def projectDir = new File(rootDir, it)
18 | include ":${it}"
19 | projectDir.eachDir { dir ->
20 | if (!dir.name.startsWith('.') && 'splunk' != dir.name) {
21 | include ":${dir.name}"
22 | project(":${dir.name}").projectDir = new File(projectDir.absolutePath, dir.name)
23 | if ('cafe' == dir.name) {
24 | dir.eachDir { cafe ->
25 | include ":${cafe.name}"
26 | project(":${cafe.name}").projectDir = new File(dir.absolutePath, cafe.name)
27 | }
28 | }
29 | }
30 | }
31 | }
32 |
--------------------------------------------------------------------------------
/.github/ISSUE_TEMPLATE/bug_report.md:
--------------------------------------------------------------------------------
1 | ---
2 | name: Bug report
3 | about: Create a report to help us improve
4 | title: ''
5 | labels: 'type: bug, status: waiting-for-triage'
6 | assignees: ''
7 |
8 | ---
9 |
10 | **In what version(s) of Spring Integration are you seeing this issue?**
11 |
12 | For example:
13 |
14 | 2.5.3
15 |
16 | Between 2.5.0 and 3.0.0
17 |
18 | **Describe the bug**
19 |
20 | A clear and concise description of what the bug is.
21 |
22 | **To Reproduce**
23 |
24 | Steps to reproduce the behavior.
25 |
26 | **Expected behavior**
27 |
28 | A clear and concise description of what you expected to happen.
29 |
30 | **Sample**
31 |
32 | A link to a GitHub repository with a [minimal, reproducible sample](https://stackoverflow.com/help/minimal-reproducible-example).
33 |
34 | Reports that include a sample will take priority over reports that do not.
35 | At times, we may require a sample, so it is good to try and include a sample up front.
36 |
--------------------------------------------------------------------------------
/basic/testing-examples/src/main/resources/META-INF/spring/integration/08-errorhandling/integration-context.xml:
--------------------------------------------------------------------------------
1 |
2 |
9 |
10 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
--------------------------------------------------------------------------------
/basic/testing-examples/src/main/resources/META-INF/spring/integration/07-gateway/integration-context.xml:
--------------------------------------------------------------------------------
1 |
2 |
9 |
10 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
--------------------------------------------------------------------------------
/intermediate/multipart-http/src/main/webapp/WEB-INF/web.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | multipart-http
4 |
5 | Multipart
6 | org.springframework.web.servlet.DispatcherServlet
7 |
8 | contextConfigLocation
9 | /WEB-INF/servlet-config.xml
10 |
11 | 1
12 |
13 |
14 | Multipart
15 | *.htm
16 |
17 |
--------------------------------------------------------------------------------
/applications/loanshark/src/main/webapp/WEB-INF/views/menu.jspx:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
--------------------------------------------------------------------------------
/applications/loanshark/src/main/webapp/WEB-INF/views/views.xml:
--------------------------------------------------------------------------------
1 |
2 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
--------------------------------------------------------------------------------
/basic/jpa/README.md:
--------------------------------------------------------------------------------
1 | Spring Integration - JPA Sample
2 | ================================
3 |
4 | # Overview
5 |
6 | This sample illustrates how the JPA Components can be used. The example presented covers the following use cases
7 |
8 | * List all people from the database
9 | * Create a new Person record in the database
10 |
11 | The first example demonstrates the use of an JPA Outbound gateway to retrieve a list of people. The second example uses an JPA Outbound Gateway in order to create a new Person record and then return the newly created Person record.
12 |
13 | Hibernate works out of the box and there are 2 options on how to execute the sample:
14 |
15 | * running the "Main" class from within STS (Right-click on Main class --> Run As --> Java Application)
16 | * or from the command line:
17 | $ gradlew :jpa:run
18 |
19 | # Resources
20 |
21 | For help please take a look at the Spring Integration documentation:
22 |
23 | https://www.springsource.org/spring-integration
24 |
25 |
--------------------------------------------------------------------------------
/basic/testing-examples/src/main/resources/META-INF/spring/integration/01-chain/integration-context.xml:
--------------------------------------------------------------------------------
1 |
2 |
9 |
10 |
11 |
12 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
--------------------------------------------------------------------------------
/applications/cafe-scripted/src/main/java/org/springframework/integration/samples/cafe/DrinkType.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2002-present the original author or authors.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * https://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | package org.springframework.integration.samples.cafe;
18 |
19 | /**
20 | * @author Mark Fisher
21 | */
22 | public enum DrinkType {
23 |
24 | ESPRESSO,
25 | LATTE,
26 | CAPPUCCINO,
27 | MOCHA
28 |
29 | }
30 |
--------------------------------------------------------------------------------
/basic/tcp-client-server/src/main/java/org/springframework/integration/samples/tcpclientserver/SimpleGateway.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2002-present the original author or authors.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * https://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | package org.springframework.integration.samples.tcpclientserver;
18 |
19 | /**
20 | * @author Gary Russell
21 | *
22 | */
23 | public interface SimpleGateway {
24 |
25 | String send(String text);
26 |
27 | }
28 |
--------------------------------------------------------------------------------
/basic/http/src/main/java/org/springframework/integration/samples/http/RequestGateway.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2002-present the original author or authors.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * https://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | package org.springframework.integration.samples.http;
18 |
19 | /**
20 | * @author Oleg Zhurakousky
21 | * @author Gunnar Hillert
22 | *
23 | */
24 | public interface RequestGateway {
25 |
26 | String echo(String request);
27 |
28 | }
29 |
--------------------------------------------------------------------------------
/basic/barrier/src/main/java/org/springframework/integration/samples/barrier/RequestGateway.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2002-present the original author or authors.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * https://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | package org.springframework.integration.samples.barrier;
18 |
19 | /**
20 | * @author Oleg Zhurakousky
21 | * @author Gunnar Hillert
22 | *
23 | */
24 | public interface RequestGateway {
25 |
26 | String echo(String request);
27 |
28 | }
29 |
--------------------------------------------------------------------------------
/intermediate/splitter-aggregator-reaper/src/main/java/org/springframework/integration/samples/splitteraggregator/Result.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2002-present the original author or authors.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * https://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | package org.springframework.integration.samples.splitteraggregator;
18 |
19 | /**
20 | * The result for a search query.
21 | *
22 | * @author Christopher Hunt
23 | *
24 | */
25 | public class Result {
26 | }
27 |
--------------------------------------------------------------------------------
/basic/control-bus/src/main/resources/META-INF/spring/integration/ControlBusDemo-context.xml:
--------------------------------------------------------------------------------
1 |
2 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
20 |
21 |
22 |
23 |
--------------------------------------------------------------------------------
/basic/testing-examples/src/test/java/org/springframework/integration/samples/testing/errorhandling/GatewayTests-context.xml:
--------------------------------------------------------------------------------
1 |
2 |
9 |
10 |
11 |
12 |
13 |
15 |
16 |
18 |
19 |
20 |
21 |
22 |
23 |
--------------------------------------------------------------------------------
/basic/ftp/src/test/java/org/springframework/integration/samples/ftp/ToFtpFlowGateway.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2002-present the original author or authors.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * https://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | package org.springframework.integration.samples.ftp;
18 |
19 | import java.util.List;
20 |
21 | /**
22 | * @author Gary Russell
23 | * @since 2.1
24 | *
25 | */
26 | interface ToFtpFlowGateway {
27 |
28 | List lsGetAndRmFiles(String dir);
29 |
30 | }
31 |
--------------------------------------------------------------------------------
/basic/sftp/src/test/java/org/springframework/integration/samples/sftp/ToSftpFlowGateway.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2002-present the original author or authors.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * https://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | package org.springframework.integration.samples.sftp;
18 |
19 | import java.util.List;
20 |
21 | /**
22 | * @author Gary Russell
23 | * @since 2.1
24 | *
25 | */
26 | interface ToSftpFlowGateway {
27 |
28 | List lsGetAndRmFiles(String dir);
29 | }
30 |
--------------------------------------------------------------------------------
/basic/ws-inbound-gateway/src/main/webapp/WEB-INF/web.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | ws:inbound-gateway sample
4 |
5 |
6 | spring-ws
7 | org.springframework.ws.transport.http.MessageDispatcherServlet
8 |
9 | contextConfigLocation
10 | WEB-INF/spring-ws-config.xml
11 |
12 | 1
13 |
14 |
15 |
16 | spring-ws
17 | /echoservice
18 |
19 |
20 |
21 | index.html
22 |
23 |
24 |
25 |
--------------------------------------------------------------------------------
/applications/cafe/cafe-si/src/main/java/org/springframework/integration/samples/cafe/DrinkType.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2002-present the original author or authors.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * https://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | package org.springframework.integration.samples.cafe;
18 |
19 | import java.io.Serializable;
20 |
21 | /**
22 | * @author Mark Fisher
23 | */
24 | public enum DrinkType implements Serializable {
25 |
26 | ESPRESSO,
27 | LATTE,
28 | CAPPUCCINO,
29 | MOCHA
30 |
31 | }
32 |
--------------------------------------------------------------------------------
/basic/helloworld/src/main/resources/META-INF/spring/integration/helloWorldDemo.xml:
--------------------------------------------------------------------------------
1 |
2 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
20 |
21 |
22 |
23 |
24 |
--------------------------------------------------------------------------------
/applications/loanshark/src/main/webapp/WEB-INF/i18n/application.properties:
--------------------------------------------------------------------------------
1 | #Updated at Tue Sep 07 17:11:50 EDT 2010
2 | #Tue Sep 07 17:11:50 EDT 2010
3 | label_org_springframework_integration_samples_loanbroker_loanshark_domain_loanshark_averagerate=Average Rate
4 | menu_item_loanshark_new_label=Loan Shark
5 | menu_item_loanshark_name_label=Name
6 | label_org_springframework_integration_samples_loanbroker_loanshark_domain_loanshark_version=Version
7 | application_name=Loanshark
8 | label_org_springframework_integration_samples_loanbroker_loanshark_domain_loanshark_name=Name
9 | label_org_springframework_integration_samples_loanbroker_loanshark_domain_loanshark_plural=Loan Sharks
10 | label_org_springframework_integration_samples_loanbroker_loanshark_domain_loanshark=Loan Shark
11 | menu_category_loanshark_label=Loan Shark
12 | label_org_springframework_integration_samples_loanbroker_loanshark_domain_loanshark_id=Id
13 | menu_item_loanshark_list_label=Loan Sharks
14 | label_org_springframework_integration_samples_loanbroker_loanshark_domain_loanshark_counter=Counter
15 |
--------------------------------------------------------------------------------
/basic/helloworld-kotlin/src/main/kotlin/org/springframework/integration/samples/helloworld/HelloService.kt:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2025-present the original author or authors.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * https://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | package org.springframework.integration.samples.helloworld
18 |
19 | /**
20 | * Simple POJO to be referenced from a Service Activator.
21 | *
22 | * @author Glenn Renfro
23 | */
24 | class HelloService {
25 |
26 | fun sayHello(name: String) = "Hello $name"
27 |
28 | }
29 |
--------------------------------------------------------------------------------
/intermediate/splitter-aggregator-reaper/src/main/java/org/springframework/integration/samples/splitteraggregator/support/CriteriaA.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2002-present the original author or authors.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * https://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | package org.springframework.integration.samples.splitteraggregator.support;
18 |
19 | /**
20 | * One type of criteria.
21 | *
22 | * @author Christopher Hunt
23 | *
24 | */
25 | public class CriteriaA extends AbstractCriteria {
26 |
27 | }
28 |
--------------------------------------------------------------------------------
/intermediate/splitter-aggregator-reaper/src/main/java/org/springframework/integration/samples/splitteraggregator/support/CriteriaB.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2002-present the original author or authors.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * https://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | package org.springframework.integration.samples.splitteraggregator.support;
18 |
19 | /**
20 | * Another type of criteria.
21 | *
22 | * @author Christopher Hunt
23 | *
24 | */
25 | public class CriteriaB extends AbstractCriteria {
26 |
27 | }
28 |
--------------------------------------------------------------------------------
/basic/barrier/src/main/java/org/springframework/integration/samples/barrier2/Gateway.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2015-present the original author or authors.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * https://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | package org.springframework.integration.samples.barrier2;
18 |
19 | import java.util.Collection;
20 |
21 | /**
22 | * @author Gary Russell
23 | * @since 4.2
24 | *
25 | */
26 | public interface Gateway {
27 |
28 | void process(Collection numbers, String correlationId);
29 |
30 | }
31 |
--------------------------------------------------------------------------------
/intermediate/async-gateway/src/main/java/org/springframework/integration/samples/async/gateway/MathServiceGateway.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2002-present the original author or authors.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * https://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | package org.springframework.integration.samples.async.gateway;
18 |
19 | import java.util.concurrent.Future;
20 |
21 | /**
22 | * @author Oleg Zhurakousky
23 | *
24 | */
25 | public interface MathServiceGateway {
26 |
27 | Future multiplyByTwo(int i);
28 | }
29 |
--------------------------------------------------------------------------------
/intermediate/splitter-aggregator-reaper/src/main/java/org/springframework/integration/samples/splitteraggregator/support/AbstractCriteria.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2002-present the original author or authors.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * https://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | package org.springframework.integration.samples.splitteraggregator.support;
18 |
19 | /**
20 | * A class that represents all criteria.
21 | *
22 | * @author Christopher Hunt
23 | *
24 | */
25 | public abstract class AbstractCriteria {
26 |
27 | }
28 |
--------------------------------------------------------------------------------
/intermediate/tcp-client-server-multiplex/src/main/java/org/springframework/integration/samples/tcpclientserver/SimpleGateway.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2002-present the original author or authors.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * https://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | package org.springframework.integration.samples.tcpclientserver;
18 |
19 | /**
20 | * @author Gary Russell
21 | * @author Gunnar Hillert
22 | * @since 2.1
23 | *
24 | */
25 | public interface SimpleGateway {
26 |
27 | String send(String text);
28 |
29 | }
30 |
--------------------------------------------------------------------------------
/applications/cafe/cafe-jms/src/main/resources/META-INF/spring/integration/activemq/cafeDemo-amq-config.xml:
--------------------------------------------------------------------------------
1 |
2 |
5 |
6 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
--------------------------------------------------------------------------------
/applications/loanshark/src/main/resources/META-INF/persistence.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
--------------------------------------------------------------------------------
/advanced/dynamic-ftp/src/test/resources/META-INF/spring/integration/DynamicFtpOutboundChannelAdapterSample-context.xml:
--------------------------------------------------------------------------------
1 |
2 |
9 |
10 |
11 |
12 |
13 |
14 |
16 |
17 |
18 |
--------------------------------------------------------------------------------
/basic/helloworld-groovy/src/main/groovy/org/springframework/integration/samples/helloworld/HelloService.groovy:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2025-present the original author or authors.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * https://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | package org.springframework.integration.samples.helloworld
18 |
19 | /**
20 | * Simple POJO to be referenced from a Service Activator.
21 | *
22 | * @author Glenn Renfro
23 | */
24 | class HelloService {
25 |
26 | String sayHello(String name) {
27 | "Hello $name"
28 | }
29 |
30 | }
31 |
32 |
--------------------------------------------------------------------------------
/basic/helloworld/src/main/java/org/springframework/integration/samples/helloworld/HelloService.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2002-present the original author or authors.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * https://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | package org.springframework.integration.samples.helloworld;
18 |
19 | /**
20 | * Simple POJO to be referenced from a Service Activator.
21 | *
22 | * @author Mark Fisher
23 | */
24 | public class HelloService {
25 |
26 | public String sayHello(String name) {
27 | return "Hello " + name;
28 | }
29 |
30 | }
31 |
--------------------------------------------------------------------------------
/intermediate/stored-procedures-derby/README.md:
--------------------------------------------------------------------------------
1 | Spring Integration - Stored Procedure Example - Derby
2 | ================================================================================
3 |
4 | # Overview
5 |
6 | This example provides a simple example using the stored procedure Outbound Gateway
7 | adapter. This example will call 2 Derby Stored Procedures.
8 |
9 | One procedure uses an **Out** Parameter to return values and the second procedure
10 | returns a **ResultSet**.
11 |
12 | # Setup
13 |
14 | Just make sure you have Gradle set up and that the project builds successfully.
15 |
16 | # Run the Sample
17 |
18 | * running the "Main" class from within STS (Right-click on Main class --> Run As --> Java Application)
19 | * or from the command line:
20 |
21 | $ gradlew :stored-procedures-derby:run
22 |
23 | * Follow the screen (command line) instructions.
24 |
25 | --------------------------------------------------------------------------------
26 |
27 | For help please take a look at the Spring Integration documentation:
28 |
29 | https://www.springsource.org/spring-integration
30 |
31 |
--------------------------------------------------------------------------------
/applications/cafe-scripted/src/main/java/org/springframework/integration/samples/cafe/WaiterMonitor.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2002-present the original author or authors.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * https://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | package org.springframework.integration.samples.cafe;
18 |
19 | /**
20 | * Send a groovy script to the control bus and return the result
21 | *
22 | * @author David Turanski
23 | * @author Artem Bilan
24 | *
25 | */
26 | public interface WaiterMonitor {
27 |
28 | Integer sendControlScript(String script);
29 |
30 | }
31 |
--------------------------------------------------------------------------------
/basic/ws-inbound-gateway/src/main/resources/META-INF/spring/integration/inbound-gateway-config.xml:
--------------------------------------------------------------------------------
1 |
2 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
--------------------------------------------------------------------------------
/applications/loanshark/src/main/webapp/WEB-INF/views/loansharks/show.jspx:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
--------------------------------------------------------------------------------
/basic/testing-examples/src/main/java/org/springframework/integration/samples/testing/externalgateway/WeatherAndTraffic.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2002-present the original author or authors.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * https://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | package org.springframework.integration.samples.testing.externalgateway;
18 |
19 | import java.util.List;
20 |
21 | /**
22 | * @author Gary Russell
23 | * @author Gunnar Hillert
24 | * @since 2.0.2
25 | *
26 | */
27 | public interface WeatherAndTraffic {
28 |
29 | List getByZip(String zip);
30 |
31 | }
32 |
--------------------------------------------------------------------------------
/intermediate/monitoring/src/main/webapp/WEB-INF/views/twitterMessages.jsp:
--------------------------------------------------------------------------------
1 | <%@ include file="/WEB-INF/views/includes/taglibs.jsp"%>
2 |
This example searches Twitter and shows the results below.
3 |
4 |
5 |
6 |
7 |
8 |
12 |
13 |
14 |
15 | No Twitter messages found. Did you start the search?
16 |
17 |
18 |
--------------------------------------------------------------------------------
/dsl/si4demo/src/main/resources/BXMLAndPojo-context.xml:
--------------------------------------------------------------------------------
1 |
2 |
9 |
10 |
11 |
12 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
--------------------------------------------------------------------------------
/advanced/dynamic-tcp-client/src/test/java/org/springframework/integration/samples/dynamictcp/DynamicTcpClientApplicationTests.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2016-present the original author or authors.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * https://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | package org.springframework.integration.samples.dynamictcp;
18 |
19 | import org.junit.jupiter.api.Test;
20 |
21 | import org.springframework.boot.test.context.SpringBootTest;
22 |
23 | @SpringBootTest
24 | public class DynamicTcpClientApplicationTests {
25 |
26 | @Test
27 | public void contextLoads() {
28 | }
29 |
30 | }
31 |
--------------------------------------------------------------------------------
/applications/loanshark/src/main/webapp/WEB-INF/views/loansharks/update.jspx:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
--------------------------------------------------------------------------------
/basic/mqtt/README.md:
--------------------------------------------------------------------------------
1 | Spring Integration - MQTT Sample
2 | ================================
3 |
4 | # Overview
5 |
6 | This sample demonstrates basic functionality of the **Spring Integration MQTT Adapters**.
7 |
8 | It assumes a broker is running on localhost on port 1883.
9 |
10 | Once the application is started, you enter some text on the command prompt and a message containing that entered text is
11 | dispatched to the MQTT topic. In return that message is retrieved by Spring Integration and then logged.
12 |
13 | # How to Run the Sample
14 |
15 | If you imported the example into your IDE, you can just run class **org.springframework.integration.samples.mqtt.Application**.
16 | For example in [SpringSource Tool Suite](https://www.springsource.com/developer/sts) (STS) do:
17 |
18 | * Right-click on SampleSimple class --> Run As --> Spring Boot App
19 |
20 | (or run from the boot console).
21 |
22 | Alternatively, you can start the sample from the command line:
23 |
24 | * ./gradlew :mqtt:run
25 |
26 | Enter some data (e.g. `foo`) on the console; you will see `foo sent to MQTT, received from MQTT`
27 |
28 | Ctrl-C to terminate.
29 |
30 |
--------------------------------------------------------------------------------
/basic/helloworld/src/main/resources/META-INF/spring/integration/delay.xml:
--------------------------------------------------------------------------------
1 |
2 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
--------------------------------------------------------------------------------
/intermediate/travel/src/main/java/org/springframework/integration/samples/travel/WeatherRequestTransformer.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2002-present the original author or authors.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * https://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | package org.springframework.integration.samples.travel;
18 |
19 | public class WeatherRequestTransformer {
20 |
21 | public String transform(City city) {
22 | return "" +
23 | " " + city.getPostalCode() + "" +
24 | "";
25 | }
26 | }
27 |
--------------------------------------------------------------------------------
/applications/loanshark/src/main/java/org/springframework/integration/samples/loanbroker/loanshark/biz/SharkTransformer.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2002-present the original author or authors.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * https://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | package org.springframework.integration.samples.loanbroker.loanshark.biz;
18 |
19 | /**
20 | * @author Gary Russell
21 | *
22 | */
23 | public class SharkTransformer {
24 |
25 | public SharkQuote transform(byte[] buffer) {
26 | String[] data = new String(buffer).split(",");
27 | return new SharkQuote(data[0], Double.parseDouble(data[1]));
28 | }
29 | }
30 |
--------------------------------------------------------------------------------
/basic/testing-examples/src/main/java/org/springframework/integration/samples/testing/filter/PetFilter.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2002-present the original author or authors.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * https://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | package org.springframework.integration.samples.testing.filter;
18 |
19 | import org.springframework.integration.annotation.Filter;
20 |
21 | /**
22 | * @author Gary Russell
23 | * @since 2.0.2
24 | *
25 | */
26 | public class PetFilter {
27 |
28 | @Filter
29 | public boolean dogsOnly(String input) {
30 | return input.toLowerCase().contains("dog");
31 | }
32 |
33 | }
34 |
--------------------------------------------------------------------------------
/advanced/README.md:
--------------------------------------------------------------------------------
1 | Advanced Samples
2 | ================
3 |
4 | This category targets advanced developers who are well familiar with the [Spring Integration](https://www.springsource.org/spring-integration) framework but are looking to extend it to address a specific custom need by extending from Spring Integration's public API.
5 |
6 | For example; if you are looking for samples showing you how to implement a custom **Channel** or **Consumer** (event-based or polling-based), or if you trying to figure out what is the most appropriate way to implement a custom **BeanParser** on top of the Spring Integration BeanParser hierarchy when implementing custom namespaces, this would be the right place to look.
7 |
8 | Here you can also find samples that will help you with adapter development. Spring Integration comes with an extensive library of adapters that allow you to connect remote systems with Spring Integration messaging framework. However you might have a need to integrate with systems for which the core framework does not provide an adapter and consequently you may have to implement your own adapter. This category would include samples showing you how to implement various adapters.
9 |
--------------------------------------------------------------------------------
/basic/quote/src/main/java/org/springframework/integration/samples/quote/TickerStream.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2002-present the original author or authors.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * https://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | package org.springframework.integration.samples.quote;
18 |
19 | import java.util.Random;
20 |
21 | /**
22 | * @author Mark Fisher
23 | */
24 | public class TickerStream {
25 |
26 | public String nextTicker() {
27 | char[] chars = new char[3];
28 | for (int i = 0; i < 3; i++) {
29 | chars[i] = (char) (new Random().nextInt(25) + 65);
30 | }
31 | return new String(chars);
32 | }
33 |
34 | }
35 |
--------------------------------------------------------------------------------
/dsl/si4demo/src/main/resources/AXML-context.xml:
--------------------------------------------------------------------------------
1 |
2 |
9 |
10 |
13 |
14 |
15 |
16 |
18 |
19 |
20 |
21 |
23 |
24 |
25 |
--------------------------------------------------------------------------------
/intermediate/errorhandling/src/main/java/org/springframework/integration/samples/errorhandling/Invitation.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2002-present the original author or authors.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * https://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | package org.springframework.integration.samples.errorhandling;
18 |
19 | /**
20 | * @author Iwein Fuld
21 | */
22 | public class Invitation {
23 |
24 | private final int number;
25 |
26 | public Invitation(int number) {
27 | this.number = number;
28 | }
29 |
30 | @Override
31 | public String toString() {
32 | return "Invitation number " + this.number;
33 | }
34 |
35 | }
36 |
--------------------------------------------------------------------------------
/intermediate/multipart-http/src/main/java/org/springframework/integration/samples/multipart/MultipartRequestGateway.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2002-present the original author or authors.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * https://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | package org.springframework.integration.samples.multipart;
18 |
19 | import java.util.Map;
20 |
21 | import org.springframework.http.HttpStatus;
22 |
23 | /**
24 | * @author ozhurakousky
25 | * @author Gunnar Hillert
26 | *
27 | */
28 | public interface MultipartRequestGateway {
29 |
30 | HttpStatus postMultipartRequest(Map multipartRequest);
31 | }
32 |
--------------------------------------------------------------------------------
/basic/feed/src/test/resources/META-INF/spring/integration/FeedInboundChannelAdapterSample-context.xml:
--------------------------------------------------------------------------------
1 |
2 |
8 |
9 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
--------------------------------------------------------------------------------
/applications/cafe-scripted/src/main/java/org/springframework/integration/samples/cafe/Customer.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2002-present the original author or authors.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * https://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | package org.springframework.integration.samples.cafe;
18 |
19 | /**
20 | * @author David Turanski
21 | *
22 | */
23 | public class Customer {
24 |
25 | int orderNumber = 1;
26 |
27 | public Order getOrder() {
28 | Order order = new Order(this.orderNumber++);
29 | order.addItem(DrinkType.LATTE, 2, false);
30 | order.addItem(DrinkType.MOCHA, 3, true);
31 | return order;
32 | }
33 |
34 | }
35 |
--------------------------------------------------------------------------------
/applications/loanshark/src/main/webapp/WEB-INF/views/loansharks/views.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
--------------------------------------------------------------------------------
/basic/quote/README.md:
--------------------------------------------------------------------------------
1 | Quote Sample
2 | ============
3 |
4 | This example demonstrates the following aspects of the CORE EIP support available with Spring Integration:
5 |
6 | 1. Channel Adapter (Inbound and Stdout)
7 | 2. Poller with Interval Triggers
8 | 3. Service Activator
9 |
10 | It is a very simple example that introduces you to Channel adapters and Pollers.
11 |
12 | Messages are simply being emitted by the *Poller* (interval based) triggering the **nextTicker()** method of the *TickerStream* class and are then sent to a **tickers** channel, from which they are retrieved by the *TickerStream* service.
13 |
14 | The *TickerStream* service generates random ticker symbols, sending them to the **quotes** channel, from which they are retrieved by the *QuoteService* (annotation based Service Activator). The *QuoteService* generates random quotes, sending them to the *Stdout Channel Adapter*, where they are printed to the console.
15 |
16 | To execute sample simply run **QuoteDemoTest**. You should see the output similar to this:
17 |
18 | XNY: 90.03
19 | XMR: 17.11
20 | IWR: 35.85
21 | KHR: 54.43
22 | WUW: 95.29
23 | YYC: 7.44
24 | DYW: 84.76
25 | TIW: 28.31
26 | HGE: 28.90
27 |
28 |
29 |
--------------------------------------------------------------------------------
/intermediate/travel/src/main/java/org/springframework/integration/samples/travel/TravelGateway.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2002-present the original author or authors.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * https://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | package org.springframework.integration.samples.travel;
18 |
19 | /**
20 | * Central business interface which is used to retrieve weather and traffic
21 | * information for the provided {@link City}.
22 | *
23 | * @author Gunnar Hillert
24 | * @since 2.2
25 | *
26 | */
27 | public interface TravelGateway {
28 |
29 | String getWeatherByCity(City city);
30 |
31 | String getTrafficByCity(City city);
32 |
33 | }
34 |
--------------------------------------------------------------------------------
/applications/cafe/cafe-si/src/main/java/org/springframework/integration/samples/cafe/xml/Waiter.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2002-present the original author or authors.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * https://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | package org.springframework.integration.samples.cafe.xml;
18 |
19 | import java.util.List;
20 |
21 | import org.springframework.integration.samples.cafe.Delivery;
22 | import org.springframework.integration.samples.cafe.Drink;
23 |
24 | /**
25 | * @author Marius Bogoevici
26 | */
27 | public class Waiter {
28 |
29 | public Delivery prepareDelivery(List drinks) {
30 | return new Delivery(drinks);
31 | }
32 |
33 | }
34 |
--------------------------------------------------------------------------------
/basic/jms/src/main/java/org/springframework/integration/samples/jms/DemoBean.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2002-present the original author or authors.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * https://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | package org.springframework.integration.samples.jms;
18 |
19 | import org.springframework.integration.annotation.MessageEndpoint;
20 | import org.springframework.integration.annotation.ServiceActivator;
21 |
22 | /**
23 | * @author Mark Fisher
24 | */
25 | @MessageEndpoint
26 | public class DemoBean {
27 |
28 | @ServiceActivator
29 | public String upperCase(String input) {
30 | return "JMS response: " + input.toUpperCase();
31 | }
32 | }
33 |
--------------------------------------------------------------------------------
/intermediate/async-gateway/src/main/java/org/springframework/integration/samples/async/gateway/MathService.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2002-present the original author or authors.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * https://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | package org.springframework.integration.samples.async.gateway;
18 |
19 | import java.util.Random;
20 |
21 | /**
22 | * @author Oleg Zhurakousky
23 | *
24 | */
25 | public class MathService {
26 | private final Random random = new Random();
27 |
28 | public int multiplyByTwo(int i) throws Exception {
29 | long sleep = this.random.nextInt(10) * 100;
30 | Thread.sleep(sleep);
31 | return i * 2;
32 | }
33 | }
34 |
--------------------------------------------------------------------------------
/applications/loanshark/src/main/webapp/WEB-INF/layouts/default.jspx:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
--------------------------------------------------------------------------------
/basic/jdbc/src/main/java/org/springframework/integration/samples/jdbc/domain/UserMapper.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2002-present the original author or authors.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * https://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | package org.springframework.integration.samples.jdbc.domain;
18 |
19 | import java.sql.ResultSet;
20 | import java.sql.SQLException;
21 |
22 | import org.springframework.jdbc.core.RowMapper;
23 |
24 | public class UserMapper implements RowMapper {
25 |
26 | public User mapRow(ResultSet rs, int rowNum) throws SQLException {
27 | return new User(rs.getString("username"), rs.getString("password"), rs.getString("email"));
28 | }
29 |
30 | }
31 |
--------------------------------------------------------------------------------
/intermediate/travel/src/main/resources/META-INF/spring/integration-ws-context.xml:
--------------------------------------------------------------------------------
1 |
2 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
18 |
19 |
20 |
--------------------------------------------------------------------------------
/basic/quote/src/main/java/org/springframework/integration/samples/quote/Quote.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2002-present the original author or authors.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * https://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | package org.springframework.integration.samples.quote;
18 |
19 | import java.math.BigDecimal;
20 |
21 | /**
22 | * @author Mark Fisher
23 | */
24 | public class Quote {
25 |
26 | private final String ticker;
27 |
28 | private final BigDecimal price;
29 |
30 | public Quote(String ticker, BigDecimal price) {
31 | this.ticker = ticker;
32 | this.price = price;
33 | }
34 |
35 | public String toString() {
36 | return this.ticker + ": " + this.price;
37 | }
38 |
39 | }
40 |
--------------------------------------------------------------------------------
/basic/testing-examples/src/main/java/org/springframework/integration/samples/testing/gateway/VoidGateway.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2002-present the original author or authors.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * https://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | package org.springframework.integration.samples.testing.gateway;
18 |
19 | import org.springframework.integration.file.FileHeaders;
20 | import org.springframework.messaging.handler.annotation.Header;
21 |
22 | /**
23 | * @author Gary Russell
24 | * @author Gunnar Hillert
25 | *
26 | * @since 2.0.2
27 | *
28 | */
29 | public interface VoidGateway {
30 |
31 | void process(String thing, @Header(FileHeaders.FILENAME) String fileName);
32 |
33 | }
34 |
--------------------------------------------------------------------------------
/basic/testing-examples/src/test/java/org/springframework/integration/samples/testing/filter/PetFilterTests-context.xml:
--------------------------------------------------------------------------------
1 |
2 |
9 |
10 |
11 |
12 |
14 |
15 |
16 |
17 |
18 |
19 |
21 |
22 |
23 |
24 |
25 |
26 |
28 |
29 |
30 |
31 |
32 |
33 |
--------------------------------------------------------------------------------
/applications/loanshark/src/main/webapp/WEB-INF/views/loansharks/list.jspx:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
--------------------------------------------------------------------------------
/basic/testing-examples/src/test/java/org/springframework/integration/samples/testing/router/PetRouterTests-context.xml:
--------------------------------------------------------------------------------
1 |
2 |
9 |
10 |
11 |
12 |
14 |
16 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
--------------------------------------------------------------------------------
/dsl/si4demo/src/test/java/org/springframework/integration/samples/si4demo/ApplicationTests.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2024-present the original author or authors.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * https://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | package org.springframework.integration.samples.si4demo;
18 |
19 | import org.junit.jupiter.api.Test;
20 |
21 | import org.springframework.boot.test.context.SpringBootTest;
22 | import org.springframework.integration.samples.si4demo.annotations.Application;
23 |
24 | @SpringBootTest(webEnvironment = SpringBootTest.WebEnvironment.RANDOM_PORT, classes = Application.class)
25 | public class ApplicationTests {
26 |
27 | @Test
28 | public void contextLoads() {
29 | }
30 |
31 | }
32 |
--------------------------------------------------------------------------------
/intermediate/stored-procedures-oracle/src/main/java/org/springframework/integration/service/StringConversionService.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2002-present the original author or authors.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * https://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | package org.springframework.integration.service;
18 |
19 | /**
20 | * Provides string manipulation services.
21 | */
22 | public interface StringConversionService {
23 |
24 | /**
25 | * Converts a String to Upper Case.
26 | *
27 | * @param stringToConvert The string to convert to upper case
28 | * @return The converted upper case string.
29 | */
30 | String convertToUpperCase(String stringToConvert);
31 |
32 | Integer getNumber();
33 |
34 | }
35 |
--------------------------------------------------------------------------------
/basic/testing-examples/src/main/resources/META-INF/spring/integration/06-filter/integration-context.xml:
--------------------------------------------------------------------------------
1 |
2 |
9 |
10 |
11 |
12 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
--------------------------------------------------------------------------------
/dsl/cafe-dsl/src/test/java/org/springframework/integration/samples/dsl/cafe/ApplicationTests.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2014-present the original author or authors.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * https://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | package org.springframework.integration.samples.dsl.cafe;
18 |
19 | import org.junit.jupiter.api.Test;
20 |
21 | import org.springframework.boot.test.context.SpringBootTest;
22 | import org.springframework.integration.samples.dsl.cafe.lambda.Application;
23 |
24 | /**
25 | * @author Artem Bilan
26 | *
27 | * @since 3.0
28 | */
29 | @SpringBootTest(classes = Application.class)
30 | public class ApplicationTests {
31 |
32 | @Test
33 | public void contextLoads() {
34 | }
35 |
36 | }
37 |
--------------------------------------------------------------------------------
/advanced/dynamic-tcp-client/README.adoc:
--------------------------------------------------------------------------------
1 | = Dynamic TCP Client
2 |
3 | Demonstrates a technique to dynamically add TCP clients on-demand, with caching and LRU removal.
4 |
5 | Uses the https://docs.spring.io/spring-integration/reference/html/java-dsl.html#java-dsl-runtime-flows[Spring Integration Java DSL] Runtime flow registration feature.
6 |
7 | The code starts two inbound channel adapters on ports 1234 and 5678 and sends a message to each.
8 |
9 | Run from your favorite IDE, or from the command line `./gradlew :dynamic-tcp-client:run`.
10 |
11 | The output messages show that each was received from a different socket...
12 |
13 | ```
14 | GenericMessage [payload=byte[3], headers={ip_tcp_remotePort=59000, ip_connectionId=localhost:59000:1234:fe482d5d-46d2-4708-bde8-afdcee6d3275, ip_localInetAddress=/127.0.0.1, ip_address=127.0.0.1, history=inOne,outputChannel, id=4c66210d-3855-28ad-833c-f6862d4263fb, ip_hostname=localhost, timestamp=1474483130778}]
15 | GenericMessage [payload=byte[3], headers={ip_tcp_remotePort=59001, ip_connectionId=localhost:59001:5678:e54f0ffe-83bc-40de-861f-9fa03df6e43d, ip_localInetAddress=/127.0.0.1, ip_address=127.0.0.1, history=inTwo,outputChannel, id=d6bd4319-00e1-550d-9511-3348d7fae907, ip_hostname=localhost, timestamp=1474483130784}]
16 | ```
17 |
--------------------------------------------------------------------------------
/basic/tcp-client-server/src/main/java/org/springframework/integration/samples/tcpclientserver/EchoService.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2002-present the original author or authors.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * https://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | package org.springframework.integration.samples.tcpclientserver;
18 |
19 | /**
20 | * Simple service that receives data in a byte array,
21 | * converts it to a String and appends it to 'echo:'.
22 | *
23 | * @author Gary Russell
24 | *
25 | */
26 | public class EchoService {
27 |
28 | public String test(String input) {
29 | if ("FAIL".equals(input)) {
30 | throw new RuntimeException("Failure Demonstration");
31 | }
32 | return "echo:" + input;
33 | }
34 |
35 | }
36 |
--------------------------------------------------------------------------------
/intermediate/splitter-aggregator-reaper/src/main/java/org/springframework/integration/samples/splitteraggregator/SearchRequestor.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2002-present the original author or authors.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * https://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | package org.springframework.integration.samples.splitteraggregator;
18 |
19 | import org.springframework.integration.samples.splitteraggregator.support.CompositeCriteria;
20 |
21 | /**
22 | * A service interface responsible for performing a search and returning a
23 | * result synchronously.
24 | *
25 | * @author Christopher Hunt
26 | *
27 | */
28 | public interface SearchRequestor {
29 |
30 | CompositeResult search(CompositeCriteria criteria);
31 | }
32 |
--------------------------------------------------------------------------------
/applications/stomp-chat/src/test/java/org/springframework/integration/samples/chat/stomp/server/ApplicationTests.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2014-present the original author or authors.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * https://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | package org.springframework.integration.samples.chat.stomp.server;
18 |
19 | import org.junit.jupiter.api.Test;
20 |
21 | import org.springframework.boot.test.context.SpringBootTest;
22 |
23 | /**
24 | * @author Artem Bilan
25 | *
26 | * @since 3.0
27 | */
28 | @SpringBootTest(webEnvironment = SpringBootTest.WebEnvironment.RANDOM_PORT, classes = Application.class)
29 | public class ApplicationTests {
30 |
31 | @Test
32 | public void testWebSockets() {
33 |
34 | }
35 |
36 | }
37 |
--------------------------------------------------------------------------------
/basic/testing-examples/src/test/java/org/springframework/integration/samples/testing/externalgateway/ExternalGatewaySubstitutionTests-context.xml:
--------------------------------------------------------------------------------
1 |
2 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
20 |
21 |
24 |
25 |
--------------------------------------------------------------------------------
/basic/web-sockets/src/main/resources/static/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | Time over WebSocket
5 |
6 |
19 |
20 |
21 |
22 |
24 |
Starting...
33 |
34 |
35 |
--------------------------------------------------------------------------------
/basic/twitter/src/test/java/org/springframework/integration/samples/twitter/TwitterSearchSample.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2002-present the original author or authors.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * https://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | package org.springframework.integration.samples.twitter;
18 |
19 | import org.junit.jupiter.api.Test;
20 |
21 | import org.springframework.context.support.ClassPathXmlApplicationContext;
22 |
23 | /**
24 | * @author Oleg Zhurakousky
25 | *
26 | */
27 | public class TwitterSearchSample {
28 |
29 | @Test
30 | public void runDemo() throws Exception {
31 | new ClassPathXmlApplicationContext("META-INF/spring/integration/TwitterSearch-context.xml");
32 |
33 | Thread.sleep(5000);
34 | }
35 |
36 | }
37 |
--------------------------------------------------------------------------------
/basic/http/src/main/resources/META-INF/spring/integration/http-outbound-config.xml:
--------------------------------------------------------------------------------
1 |
2 |
9 |
10 |
13 |
14 |
15 |
16 |
20 |
21 |
22 |
--------------------------------------------------------------------------------
/intermediate/splitter-aggregator-reaper/src/main/java/org/springframework/integration/samples/splitteraggregator/CompositeResult.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2002-present the original author or authors.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * https://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | package org.springframework.integration.samples.splitteraggregator;
18 |
19 | import java.util.ArrayList;
20 | import java.util.Collection;
21 |
22 | /**
23 | * A result that can contain other results.
24 | *
25 | * @author Christopher Hunt
26 | *
27 | */
28 | public class CompositeResult extends Result {
29 | private final Collection results = new ArrayList();
30 |
31 | public Collection getResults() {
32 | return this.results;
33 | }
34 | }
35 |
--------------------------------------------------------------------------------
/basic/helloworld-kotlin/src/test/kotlin/org/springframework/integration/samples/helloworld/HelloServiceTests.kt:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2025-present the original author or authors.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * https://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | package org.springframework.integration.samples.helloworld
18 |
19 | import org.assertj.core.api.Assertions.assertThat
20 | import org.junit.jupiter.api.Test
21 |
22 | /**
23 | * Unit tests for HelloService.
24 | *
25 | * @author Glenn Renfro
26 | */
27 | class HelloServiceTests {
28 |
29 | @Test
30 | fun testSayHello() {
31 | val service = HelloService()
32 | val result = service.sayHello("World")
33 | assertThat(result).isEqualTo("Hello World")
34 | }
35 |
36 | }
37 |
--------------------------------------------------------------------------------
/basic/helloworld-groovy/src/test/groovy/org/springframework/integration/samples/helloworld/HelloServiceTests.groovy:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2025-present the original author or authors.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * https://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | package org.springframework.integration.samples.helloworld
18 |
19 | import org.junit.jupiter.api.Test
20 |
21 | import static org.assertj.core.api.Assertions.assertThat
22 |
23 |
24 | /**
25 | * Unit tests for HelloService.
26 | *
27 | * @author Glenn Renfro
28 | */
29 | class HelloServiceTests {
30 |
31 | @Test
32 | void testSayHello() {
33 | def service = new HelloService()
34 | def result = service.sayHello('World')
35 | assertThat(result).isEqualTo('Hello World')
36 | }
37 |
38 | }
39 |
40 |
--------------------------------------------------------------------------------
/basic/jms/src/main/resources/META-INF/spring/integration/outboundChannelAdapter.xml:
--------------------------------------------------------------------------------
1 |
2 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
--------------------------------------------------------------------------------
/basic/xmpp/README.md:
--------------------------------------------------------------------------------
1 | XMPP Sample
2 | ===========
3 |
4 | This example was prepared for testing with [Google Talk][] and demonstrates the following aspects of the [Extensible Messaging and Presence Protocol][] (XMPP) support available with *Spring Integration*:
5 |
6 | 1. XMPP Inbound Channel Adapter - receive instant messages.
7 | 2. XMPP Outbound Channel Adapter - send instant messages.
8 |
9 | In order to run this sample you need to provide correct values in **xmpp.properties**.
10 | Everything there was already preset. The only 3 properties you need to provide values for are:
11 |
12 | * user.login
13 | * user.password
14 | * send.to.user
15 |
16 | You'll also need to test it with your friend or have two Google accounts setup.
17 |
18 | To test **SendInstantMessageSample.java**, first log on to the account identified via **send.to.user** property and make sure that that account is in your buddy list. Then run the demo.
19 | To test **ReceiveInstantMessageSample.java**, first log on to the account identified via **send.to.user** property. Then run the demo. Now any instant messages sent to your account appear in the console.
20 |
21 | [Google Talk]: https://www.google.com/talk/
22 | [Extensible Messaging and Presence Protocol]: https://en.wikipedia.org/wiki/Extensible_Messaging_and_Presence_Protocol
23 |
--------------------------------------------------------------------------------
/intermediate/splitter-aggregator-reaper/src/main/java/org/springframework/integration/samples/splitteraggregator/SearchResultAggregator.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2002-present the original author or authors.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * https://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | package org.springframework.integration.samples.splitteraggregator;
18 |
19 | import java.util.Collection;
20 |
21 | /**
22 | * Aggregate a collection of results into a composite result object.
23 | *
24 | * @author Christopher Hunt
25 | *
26 | */
27 | public class SearchResultAggregator {
28 | public Result aggregate(Collection results) {
29 | CompositeResult result = new CompositeResult();
30 | result.getResults().addAll(results);
31 | return result;
32 | }
33 | }
34 |
--------------------------------------------------------------------------------
/basic/twitter/src/test/java/org/springframework/integration/samples/twitter/TwitterTimelineUpdatesSample.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2002-present the original author or authors.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * https://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | package org.springframework.integration.samples.twitter;
18 |
19 | import org.junit.jupiter.api.Test;
20 |
21 | import org.springframework.context.support.ClassPathXmlApplicationContext;
22 |
23 | /**
24 | * @author Oleg Zhurakousky
25 | *
26 | */
27 | public class TwitterTimelineUpdatesSample {
28 |
29 | @Test
30 | public void runDemo() throws Exception {
31 | new ClassPathXmlApplicationContext("META-INF/spring/integration/TwitterTimelineUpdates-context.xml");
32 |
33 | Thread.sleep(20000);
34 | }
35 |
36 | }
37 |
--------------------------------------------------------------------------------
/basic/xmpp/src/test/java/org/springframework/integration/samples/xmpp/ReceiveInstantMessageSample.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2002-present the original author or authors.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * https://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | package org.springframework.integration.samples.xmpp;
18 |
19 | import org.junit.jupiter.api.Test;
20 |
21 | import org.springframework.context.support.ClassPathXmlApplicationContext;
22 |
23 | /**
24 | * @author Oleg Zhurakousky
25 | *
26 | */
27 | public class ReceiveInstantMessageSample {
28 |
29 | @Test
30 | public void runDemo() throws Exception {
31 | new ClassPathXmlApplicationContext("META-INF/spring/integration/ReceiveInstantMessageSample-context.xml");
32 |
33 | Thread.sleep(20000 * 10);
34 | }
35 |
36 | }
37 |
--------------------------------------------------------------------------------
/applications/cafe-scripted/README.md:
--------------------------------------------------------------------------------
1 | Cafe Demo - Scripted Implementation
2 | ===================================
3 |
4 | This is the scripted implementation of the classic **cafe** sample application. You can choose among **groovy**, **ruby**, and **python** scripting languages. The functionality is basically identical in all cases to the original cafe demo.
5 |
6 | # Instructions for running the CafeDemo sample
7 |
8 | The script language is passed as a command line argument. This may be run directly from Gradle:
9 |
10 | $ gradlew :cafe-scripted:runCafeDemoApp -Plang=[language]
11 |
12 | ## Groovy Control Bus
13 |
14 | This sample also demonstrates the use of Spring Integration's **groovy control bus** which accepts Groovy scripts as control messages. These scripts may invoke lifecycle operations on adapters or operations on managed beans.
15 |
16 | To demonstrate the control bus, while the CafeDemoApp is running, execute in a separate window:
17 |
18 | $ gradlew :cafe-scripted:runControlBus
19 |
20 | This will use groovy scripts to
21 |
22 | * Query the waiter for the total number of orders delivered
23 | * If the total orders > 3, stop the inbound adaptor on the cafe (the order flow). The Cafe application will continue to run, but eventually the output will stop when all pending orders have completed.
24 |
25 |
26 |
--------------------------------------------------------------------------------