INTSAMPLES-89 - Upgrade to Spring Integration 2.2 RC3

* Test samples
* Polish documentation
* Polish code

For reference see: https://jira.springsource.org/browse/INTSAMPLES-89
This commit is contained in:
Gunnar Hillert
2012-10-28 22:51:14 -04:00
parent 251e035a18
commit 3c9c91c847
93 changed files with 1666 additions and 1454 deletions

View File

@@ -3,14 +3,14 @@ Spring Integration Samples
# Introduction # Introduction
Welcome to the Spring Integration Samples. To simplify your experience, Spring Integration Samples were split into 4 distinct categories: Welcome to the **Spring Integration Samples** repository which provides **50+ samples** to help you learn [Spring Integration][]. To simplify your experience, the *Spring Integration* samples are split into 4 distinct categories:
* Basic * Basic
* Intermediate * Intermediate
* Advanced * Advanced
* Applications * Applications
Inside of each category you'll find a 'README.md' which will contain a more detailed description of that category's specifics. Each sample also comes with its own 'readme.txt' file explaining details. Inside of each category you'll find a **README.md** file, which will contain a more detailed description of that category. Each sample also comes with its own **README.md** file explaining further details, e.g. how to run the respective sample.
*Happy Integration!* *Happy Integration!*
@@ -31,21 +31,26 @@ Below is a short description of each category.
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. For example, if you 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, this would be the right place to find a relevant sample. The bottom line is that this is a good starting point. 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. For example, if you 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, this would be the right place to find a relevant sample. The bottom line is that this is a good starting point.
* **amqp** - demonstrates the functionality of the various **AMQP Adapters** * **amqp** - Demonstrates the functionality of the various **AMQP Adapters**
* **control-bus** - demonstrates the functionality of the **Control Bus** * **control-bus** - Demonstrates the functionality of the **Control Bus**
* **feed** - demonstrates the functionality of the **Feed Adapter** (RSS/ATOM) * **enricher** - This sample demonstrates how the Enricher components can be used
* **file** - demonstrates aspects of the various File Adapters (e.g. **File Inbound/Outbound Channel Adapters**, file **polling**) * **feed** - Demonstrates the functionality of the **Feed Adapter** (RSS/ATOM)
* **ftp** - demonstrates the **FTP support** available with Spring Integration * **file** - Demonstrates aspects of the various File Adapters (e.g. **File Inbound/Outbound Channel Adapters**, file **polling**)
* **helloworld** - very simple starting example illustrating a basic message flow (using **Channel**, **ServiceActivator**, **QueueChannel**) * **ftp** - Demonstrates the **FTP support** available with Spring Integration
* **http** - demonstrates request/reply communication when using a pair of **HTTP Inbound/Outbound gateways** * **helloworld** - Very simple starting example illustrating a basic message flow (using **Channel**, **ServiceActivator**, **QueueChannel**)
* **jms** - demonstrates **JMS** support available with Spring Integration * **http** - Demonstrates request/reply communication when using a pair of **HTTP Inbound/Outbound gateways**
* **jmx** - demonstrates **JMX** support using a **JMX Attribute Polling Channel** and **JMX Operation Invoking Channel Adapter** * **jdbc** - Illustrates the usage of the Jdbc Adapters, including object persistence and retrieval
* **mail** - example showing **IMAP** and **POP3** support * **jms** - Demonstrates **JMS** support available with Spring Integration
* **jmx** - Demonstrates **JMX** support using a **JMX Attribute Polling Channel** and **JMX Operation Invoking Channel Adapter**
* **jpa** - Shows the usage of the JPA Components can be used
* **mail** - Example showing **IMAP** and **POP3** support
* **mongodb** - Shows how to persist a Message payload to a **MongoDb** document store and how to read documents from **MongoDb**
* **oddeven** - Example combining the functionality of **Inbound Channel Adapter**, **Filter**, **Router** and **Poller** * **oddeven** - Example combining the functionality of **Inbound Channel Adapter**, **Filter**, **Router** and **Poller**
* **jpa** - This sample illustrates how the JPA Components can be used * **jpa** - This sample illustrates how the JPA Components can be used
* **quote** - Example demoing core EIP support using **Channel Adapter (Inbound and Stdout)**, **Poller** with Interval Trigers, **Service Activator** * **quote** - Example demoing core EIP support using **Channel Adapter (Inbound and Stdout)**, **Poller** with Interval Trigers, **Service Activator**
* **sftp** - demonstrating SFTP support using **SFTP Inbound / Outbound Channel Adapters** * **sftp** - Demonstrating SFTP support using **SFTP Inbound / Outbound Channel Adapters**
* **tcp-client-server** - demonstrates socket communication using **TcpOutboundGateway**, **TcpInboundGateway** and also uses a **Gateway** and a **Service Activator** * **tcp-amqp** - Demonstrates basic functionality of bridging the **Spring Integration TCP Adapters** with **Spring Integration AMQP Adapters**
* **tcp-client-server** - Demonstrates socket communication using **TcpOutboundGateway**, **TcpInboundGateway** and also uses a **Gateway** and a **Service Activator**
* **testing-examples** - A series of test cases that show techniques to **test** Spring Integration applications. * **testing-examples** - A series of test cases that show techniques to **test** Spring Integration applications.
* **twitter** - Illustrates Twitter support using the **Twitter Inbound Channel Adapter**, **Twitter Inbound Search Channel Adapter**, **Twitter Outbound Channel Adapter** * **twitter** - Illustrates Twitter support using the **Twitter Inbound Channel Adapter**, **Twitter Inbound Search Channel Adapter**, **Twitter Outbound Channel Adapter**
* **ws-inbound-gateway** - Example showing basic functionality of the **Web Service Gateway** * **ws-inbound-gateway** - Example showing basic functionality of the **Web Service Gateway**
@@ -58,36 +63,41 @@ This is a good place to get started. The samples here are technically motivated
This category targets developers who are already more familiar with the Spring Integration framework (past getting started), but need some more guidance while resolving more advanced technical problems that you have to deal with when switching to a Messaging architecture. For example, if you are looking for an answer on how to handle errors in various scenarios, or how to properly configure an **Aggregator** for the situations where some messages might not ever arrive for aggregation, or any other issue that goes beyond a basic understanding and configuration of a particular component to address "what else you can do?" types of problems, this would be the right place to find relevant examples. This category targets developers who are already more familiar with the Spring Integration framework (past getting started), but need some more guidance while resolving more advanced technical problems that you have to deal with when switching to a Messaging architecture. For example, if you are looking for an answer on how to handle errors in various scenarios, or how to properly configure an **Aggregator** for the situations where some messages might not ever arrive for aggregation, or any other issue that goes beyond a basic understanding and configuration of a particular component to address "what else you can do?" types of problems, this would be the right place to find relevant examples.
* **async-gateway** - Usage example of an asynchronous **Gateway**
* **dynamic-poller** - Example shows usage of a **Poller** with a custom **Trigger** to change polling periods at runtime * **dynamic-poller** - Example shows usage of a **Poller** with a custom **Trigger** to change polling periods at runtime
* **async-gateway** - Example shows usage of an **Asynchronous Gateway** * **async-gateway** - Example shows usage of an **Asynchronous Gateway**
* **errorhandling** - Demonstrates basic **Error Handling** capabilities of Spring Integration * **errorhandling** - Demonstrates basic **Error Handling** capabilities of Spring Integration
* **file-processing** - Sample demonstrates how to wire a message flow to process files either sequentially (maintain the order) or concurrently (no order). * **file-processing** - Sample demonstrates how to wire a message flow to process files either sequentially (maintain the order) or concurrently (no order).
* **mail-attachments** - Demonstrates the processing of email attachments * **mail-attachments** - Demonstrates the processing of email attachments
* **monitoring** The project used in the *[Spring Integration Management and Monitoring Webinar](http://www.springsource.org/node/3598)* Also available on the *[SpringSourceDev YouTube Channel](http://www.youtube.com/SpringSourceDev)*
* **multipart-http** - Demonstrates the sending of HTTP multipart requests using Spring's **RestTemplate** and a Spring Integration **Http Outbound Gateway** * **multipart-http** - Demonstrates the sending of HTTP multipart requests using Spring's **RestTemplate** and a Spring Integration **Http Outbound Gateway**
* **travel** - More sophisticated example showing the retrieval of weather (SOAP Web Service) and traffic (HTTP Service) reports using real services
* **tcp-client-server-multiplex** - Demonstrates the use of *Collaborating Channel Adapters*
* **stored-procedures-derby** Provides an example of the stored procedure Outbound Gateway using *[Apache Derby](http://db.apache.org/derby/)*
* **stored-procedures-oracle** Provides an example of the stored procedure Outbound Gateway using *ORACLE XE*
* **stored-procedures-postgresql** Provides an example of the stored procedure Outbound Gateway using *[PostgreSQL](http://www.postgresql.org/)*
* **rest-http** - This sample demonstrates how to send an HTTP request to a Spring Integration's HTTP service while utilizing Spring Integration's new HTTP Path usage. This sample also uses Spring Security for HTTP Basic authentication. With HTTP Path facility, the client program can send requests with URL Variables. * **rest-http** - This sample demonstrates how to send an HTTP request to a Spring Integration's HTTP service while utilizing Spring Integration's new HTTP Path usage. This sample also uses Spring Security for HTTP Basic authentication. With HTTP Path facility, the client program can send requests with URL Variables.
* **retry-and-more** Provides samples showing the application of MessageHandler Advice Chains to endpoints - retry, circuit breaker, expression evaluating
* **splitter-aggregator-reaper** A demonstration of implementing the Splitter and Aggregator *Enterprise Integration Patterns* (EIP) together. This sample also provides a concrete example of a [message store reaper][] in action. * **splitter-aggregator-reaper** A demonstration of implementing the Splitter and Aggregator *Enterprise Integration Patterns* (EIP) together. This sample also provides a concrete example of a [message store reaper][] in action.
* **stored-procedures-derby** Provides an example of the stored procedure Outbound Gateway using *[Apache Derby](http://db.apache.org/derby/)* * **stored-procedures-derby** Provides an example of the stored procedure Outbound Gateway using *[Apache Derby](http://db.apache.org/derby/)*
* **stored-procedures-ms** Provides an example of the stored procedure Outbound Gateway using *Microsoft SQL Server*
* **stored-procedures-oracle** Provides an example of the stored procedure Outbound Gateway using *ORACLE XE* * **stored-procedures-oracle** Provides an example of the stored procedure Outbound Gateway using *ORACLE XE*
* **monitoring** The project used in the *[Spring Integration Management and Monitoring Webinar](http://www.springsource.org/node/3598)* Also available on the *[SpringSourceDev YouTube Channel](http://www.youtube.com/SpringSourceDev)* * **stored-procedures-postgresql** Provides an example of the stored procedure Outbound Gateway using *[PostgreSQL](http://www.postgresql.org/)*
* **retry-and-more** Provides samples showing the application of MessageHandler Advice Chains to endpoints - retry, circuit breaker, expression evaluating * **tcp-client-server-multiplex** - Demonstrates the use of *Collaborating Channel Adapters*
* **tx-synch** Provides a sample demonstrating the use of transaction syncrhonization, renaming an input file to a different filename, depending on whether the transaction commits, or rolls back. * **travel** - More sophisticated example showing the retrieval of weather (SOAP Web Service) and traffic (HTTP Service) reports using real services
* **tx-synch** Provides a sample demonstrating the use of transaction synchronization, renaming an input file to a different filename, depending on whether the transaction commits, or rolls back.
## Advanced ## Advanced
This category targets advanced developers who are quite familiar with Spring Integration but are looking to address a specific custom need by extending the Spring Integration public API. For example, if you are looking for samples showing how to implement a custom **Channel** or **Consumer** (event-based or polling-based), or you are 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 a custom namespace, this would be the right place to look. 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 the Spring Integration messaging framework. However you might have a need to integrate with a system for which the core framework does not provide an adapter, so you have to implement your own. This category would include samples showing you how to implement various adapters. This category targets advanced developers who are quite familiar with Spring Integration but are looking to address a specific custom need by extending the Spring Integration public API. For example, if you are looking for samples showing how to implement a custom **Channel** or **Consumer** (event-based or polling-based), or you are 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 a custom namespace, this would be the right place to look. 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 the Spring Integration messaging framework. However you might have a need to integrate with a system for which the core framework does not provide an adapter, so you have to implement your own. This category would include samples showing you how to implement various adapters.
* **advanced-testing-examples** - Example test cases that show advanced techniques to test Spring Integration applications * **advanced-testing-examples** - Example test cases that show advanced techniques to test Spring Integration applications
* **dynamic-ftp** - Demonstrates one technique for sending files to dynamic destinations.
## Applications ## Applications
This category targets developers and architects who have a good understanding of Message-Driven architecture and Enterprise Integration Patterns, and have an above average understanding of Spring and Spring integration and who are looking for samples that address a particular business problem. In other words, the emphasis of samples in this category is '**business use cases**' and how they can be solved via a 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. This category targets developers and architects who have a good understanding of Message-Driven architecture and Enterprise Integration Patterns, and have an above average understanding of Spring and Spring integration and who are looking for samples that address a particular business problem. In other words, the emphasis of samples in this category is '**business use cases**' and how they can be solved via a 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.
* **cafe** - Emulates a simple operation of a coffee shop combining various Spring Integration adapters (Including **Router** and **Splitter**) see [Appendix A of the reference documentation](http://static.springsource.org/spring-integration/docs/latest-ga/reference/html/samples.html) for more details * **cafe** - Emulates a simple operation of a coffee shop combining various Spring Integration adapters (Including **Router** and **Splitter**) see [Appendix A of the reference documentation](http://static.springsource.org/spring-integration/docs/latest-ga/reference/html/samples.html) for more details. Implementations are provided for:
- AMQP
- JMS
- In memory channels
* **cafe-scripted** - Scripted implementation of the classic **cafe** sample application. Supports **JavaScript**, **Groovy**, **Ruby**, and **Python**.
* **loan-broker** - Simulates a simple banking application (Uses **Gateway**, **Chain**, **Header Enricher**, **Recipient List Router**, **Aggregator**) see [Appendix A of the reference documentation](http://static.springsource.org/spring-integration/docs/latest-ga/reference/html/samples.html) for more details * **loan-broker** - Simulates a simple banking application (Uses **Gateway**, **Chain**, **Header Enricher**, **Recipient List Router**, **Aggregator**) see [Appendix A of the reference documentation](http://static.springsource.org/spring-integration/docs/latest-ga/reference/html/samples.html) for more details
* **loanshark** This extension to the loan broker sample shows how to exchange messages between Spring Integration applications (and other technologies) using **UDP**. * **loanshark** This extension to the loan broker sample shows how to exchange messages between Spring Integration applications (and other technologies) using **UDP**.

View File

@@ -4,13 +4,13 @@
<modelVersion>4.0.0</modelVersion> <modelVersion>4.0.0</modelVersion>
<groupId>org.springframework.integration.samples</groupId> <groupId>org.springframework.integration.samples</groupId>
<artifactId>advanced-testing-examples</artifactId> <artifactId>advanced-testing-examples</artifactId>
<version>2.1.0.BUILD-SNAPSHOT</version> <version>2.2.0.BUILD-SNAPSHOT</version>
<name>Samples (Advanced) - Advanced Testing Examples</name> <name>Samples (Advanced) - Advanced Testing Examples</name>
<packaging>jar</packaging> <packaging>jar</packaging>
<properties> <properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<spring.integration.version>2.1.0.RELEASE</spring.integration.version> <spring.integration.version>2.2.0.RC3</spring.integration.version>
<spring.version>3.1.0.RELEASE</spring.version> <spring.version>3.1.3.RELEASE</spring.version>
<log4j.version>1.2.16</log4j.version> <log4j.version>1.2.16</log4j.version>
<junit.version>4.10</junit.version> <junit.version>4.10</junit.version>
</properties> </properties>

View File

@@ -2,14 +2,14 @@
<modelVersion>4.0.0</modelVersion> <modelVersion>4.0.0</modelVersion>
<groupId>org.springframework.integration.samples</groupId> <groupId>org.springframework.integration.samples</groupId>
<artifactId>dynamic-ftp</artifactId> <artifactId>dynamic-ftp</artifactId>
<version>2.1.0.BUILD-SNAPSHOT</version> <version>2.2.0.BUILD-SNAPSHOT</version>
<name>Samples (Advanced) - Dynamic FTP Demo</name> <name>Samples (Advanced) - Dynamic FTP Demo</name>
<packaging>jar</packaging> <packaging>jar</packaging>
<properties> <properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<spring.framework.version>3.1.0.RELEASE</spring.framework.version> <spring.framework.version>3.1.3.RELEASE</spring.framework.version>
<spring.integration.version>2.2.0.M1</spring.integration.version> <spring.integration.version>2.2.0.RC3</spring.integration.version>
<log4j.version>1.2.16</log4j.version> <log4j.version>1.2.17</log4j.version>
<junit.version>4.10</junit.version> <junit.version>4.10</junit.version>
</properties> </properties>
<dependencies> <dependencies>
@@ -54,17 +54,18 @@
<plugin> <plugin>
<groupId>org.apache.maven.plugins</groupId> <groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId> <artifactId>maven-compiler-plugin</artifactId>
<version>2.3.2</version> <version>2.5.1</version>
<configuration> <configuration>
<source>1.5</source> <source>1.6</source>
<target>1.5</target> <target>1.6</target>
<compilerArgument>-Xlint:all</compilerArgument> <compilerArgument>-Xlint:all</compilerArgument>
<showWarnings>true</showWarnings> <showWarnings>true</showWarnings>
<showDeprecation>false</showDeprecation> <showDeprecation>true</showDeprecation>
</configuration> </configuration>
</plugin> </plugin>
<plugin> <plugin>
<artifactId>maven-surefire-plugin</artifactId> <artifactId>maven-surefire-plugin</artifactId>
<version>2.12.4</version>
<configuration> <configuration>
<includes> <includes>
<include>**/*Tests.java</include> <include>**/*Tests.java</include>

View File

@@ -26,7 +26,6 @@ import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext; import org.springframework.context.support.ClassPathXmlApplicationContext;
import org.springframework.integration.Message; import org.springframework.integration.Message;
import org.springframework.integration.MessageChannel; import org.springframework.integration.MessageChannel;
import org.springframework.integration.MessageHandlingException;
import org.springframework.integration.MessagingException; import org.springframework.integration.MessagingException;
import org.springframework.integration.support.MessageBuilder; import org.springframework.integration.support.MessageBuilder;
@@ -50,14 +49,14 @@ public class FtpOutboundChannelAdapterSample {
channel.send(message); channel.send(message);
} catch (MessagingException e) { } catch (MessagingException e) {
assertTrue(e.getCause().getCause() instanceof UnknownHostException); assertTrue(e.getCause().getCause() instanceof UnknownHostException);
assertEquals("host.for.cust1", e.getCause().getCause().getMessage()); assertTrue(e.getCause().getCause().getMessage().startsWith("host.for.cust1"));
} }
// send another so we can see in the log we don't create the ac again. // send another so we can see in the log we don't create the ac again.
try { try {
channel.send(message); channel.send(message);
} catch (MessagingException e) { } catch (MessagingException e) {
assertTrue(e.getCause().getCause() instanceof UnknownHostException); assertTrue(e.getCause().getCause() instanceof UnknownHostException);
assertEquals("host.for.cust1", e.getCause().getCause().getMessage()); assertTrue(e.getCause().getCause().getMessage().startsWith("host.for.cust1"));
} }
// send to a different customer; again, check the log to see a new ac is built // send to a different customer; again, check the log to see a new ac is built
message = MessageBuilder.withPayload(file) message = MessageBuilder.withPayload(file)
@@ -66,10 +65,10 @@ public class FtpOutboundChannelAdapterSample {
channel.send(message); channel.send(message);
} catch (MessagingException e) { } catch (MessagingException e) {
assertTrue(e.getCause().getCause() instanceof UnknownHostException); assertTrue(e.getCause().getCause() instanceof UnknownHostException);
assertEquals("host.for.cust2", e.getCause().getCause().getMessage()); assertTrue(e.getCause().getCause().getMessage().startsWith("host.for.cust2"));
} }
// send to a different customer; again, check the log to see a new ac is built // send to a different customer; again, check the log to see a new ac is built
//and the first one created (cust1) should be closed and removed as per the max cache size restriction //and the first one created (cust1) should be closed and removed as per the max cache size restriction
message = MessageBuilder.withPayload(file) message = MessageBuilder.withPayload(file)
.setHeader("customer", "cust3").build(); .setHeader("customer", "cust3").build();
@@ -77,10 +76,10 @@ public class FtpOutboundChannelAdapterSample {
channel.send(message); channel.send(message);
} catch (MessagingException e) { } catch (MessagingException e) {
assertTrue(e.getCause().getCause() instanceof UnknownHostException); assertTrue(e.getCause().getCause() instanceof UnknownHostException);
assertEquals("host.for.cust3", e.getCause().getCause().getMessage()); assertTrue(e.getCause().getCause().getMessage().startsWith("host.for.cust3"));
} }
//send to cust1 again, since this one has been invalidated before, we should //send to cust1 again, since this one has been invalidated before, we should
//see a new ac created (with ac of cust2 destroyed and removed) //see a new ac created (with ac of cust2 destroyed and removed)
message = MessageBuilder.withPayload(file) message = MessageBuilder.withPayload(file)
.setHeader("customer", "cust1").build(); .setHeader("customer", "cust1").build();

View File

@@ -5,7 +5,7 @@
<modelVersion>4.0.0</modelVersion> <modelVersion>4.0.0</modelVersion>
<groupId>org.springframework.integration.samples</groupId> <groupId>org.springframework.integration.samples</groupId>
<artifactId>advanced-samples</artifactId> <artifactId>advanced-samples</artifactId>
<version>2.1.0.RELEASE</version> <version>2.2.0.BUILD-SNAPSHOT</version>
<name>Spring Integration Samples - Advanced</name> <name>Spring Integration Samples - Advanced</name>
<packaging>pom</packaging> <packaging>pom</packaging>

View File

@@ -4,13 +4,13 @@
<modelVersion>4.0.0</modelVersion> <modelVersion>4.0.0</modelVersion>
<groupId>org.springframework.integration.samples</groupId> <groupId>org.springframework.integration.samples</groupId>
<artifactId>cafe-scripted</artifactId> <artifactId>cafe-scripted</artifactId>
<version>2.1.0.BUILD-SNAPSHOT</version> <version>2.2.0.BUILD-SNAPSHOT</version>
<name>Samples (Applications) - Cafe Sample (Scripted Implementation)</name> <name>Samples (Applications) - Cafe Sample (Scripted Implementation)</name>
<properties> <properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<spring.integration.version>2.1.0.RELEASE</spring.integration.version> <spring.integration.version>2.2.0.RC3</spring.integration.version>
<spring.version>3.1.0.RELEASE</spring.version> <spring.version>3.1.3.RELEASE</spring.version>
<log4j.version>1.2.16</log4j.version> <log4j.version>1.2.17</log4j.version>
<junit.version>4.10</junit.version> <junit.version>4.10</junit.version>
</properties> </properties>
@@ -114,13 +114,13 @@
<plugin> <plugin>
<groupId>org.apache.maven.plugins</groupId> <groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId> <artifactId>maven-compiler-plugin</artifactId>
<version>2.3.2</version> <version>2.5.1</version>
<configuration> <configuration>
<source>1.5</source> <source>1.6</source>
<target>1.6</target> <target>1.6</target>
<compilerArgument>-Xlint:all</compilerArgument> <compilerArgument>-Xlint:all</compilerArgument>
<showWarnings>true</showWarnings> <showWarnings>true</showWarnings>
<showDeprecation>false</showDeprecation> <showDeprecation>true</showDeprecation>
</configuration> </configuration>
</plugin> </plugin>
</plugins> </plugins>

View File

@@ -6,7 +6,7 @@
<parent> <parent>
<artifactId>cafe</artifactId> <artifactId>cafe</artifactId>
<groupId>org.springframework.integration.samples</groupId> <groupId>org.springframework.integration.samples</groupId>
<version>2.1.0.BUILD-SNAPSHOT</version> <version>2.2.0.BUILD-SNAPSHOT</version>
</parent> </parent>
<artifactId>cafe-amqp</artifactId> <artifactId>cafe-amqp</artifactId>

View File

@@ -6,7 +6,7 @@
<parent> <parent>
<groupId>org.springframework.integration.samples</groupId> <groupId>org.springframework.integration.samples</groupId>
<artifactId>cafe</artifactId> <artifactId>cafe</artifactId>
<version>2.1.0.BUILD-SNAPSHOT</version> <version>2.2.0.BUILD-SNAPSHOT</version>
</parent> </parent>
<artifactId>cafe-jms</artifactId> <artifactId>cafe-jms</artifactId>

View File

@@ -6,7 +6,7 @@
<parent> <parent>
<artifactId>cafe</artifactId> <artifactId>cafe</artifactId>
<groupId>org.springframework.integration.samples</groupId> <groupId>org.springframework.integration.samples</groupId>
<version>2.1.0.BUILD-SNAPSHOT</version> <version>2.2.0.BUILD-SNAPSHOT</version>
</parent> </parent>
<artifactId>cafe-si</artifactId> <artifactId>cafe-si</artifactId>

View File

@@ -5,7 +5,7 @@
<groupId>org.springframework.integration.samples</groupId> <groupId>org.springframework.integration.samples</groupId>
<artifactId>cafe</artifactId> <artifactId>cafe</artifactId>
<packaging>pom</packaging> <packaging>pom</packaging>
<version>2.1.0.BUILD-SNAPSHOT</version> <version>2.2.0.BUILD-SNAPSHOT</version>
<prerequisites> <prerequisites>
<maven>2.2.1</maven> <maven>2.2.1</maven>
@@ -21,9 +21,9 @@
<properties> <properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<spring.integration.version>2.1.0.RELEASE</spring.integration.version> <spring.integration.version>2.2.0.RC3</spring.integration.version>
<spring.core.version>3.1.0.RELEASE</spring.core.version> <spring.core.version>3.1.3.RELEASE</spring.core.version>
<log4j.version>1.2.16</log4j.version> <log4j.version>1.2.17</log4j.version>
<junit.version>4.10</junit.version> <junit.version>4.10</junit.version>
</properties> </properties>
<dependencies> <dependencies>
@@ -70,10 +70,10 @@
<plugin> <plugin>
<groupId>org.apache.maven.plugins</groupId> <groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId> <artifactId>maven-compiler-plugin</artifactId>
<version>2.3.2</version> <version>2.5.1</version>
<configuration> <configuration>
<source>1.5</source> <source>1.6</source>
<target>1.5</target> <target>1.6</target>
<compilerArgument>-Xlint:all</compilerArgument> <compilerArgument>-Xlint:all</compilerArgument>
<showWarnings>true</showWarnings> <showWarnings>true</showWarnings>
<showDeprecation>true</showDeprecation> <showDeprecation>true</showDeprecation>

View File

@@ -4,13 +4,13 @@
<modelVersion>4.0.0</modelVersion> <modelVersion>4.0.0</modelVersion>
<groupId>org.springframework.integration.samples</groupId> <groupId>org.springframework.integration.samples</groupId>
<artifactId>loan-broker</artifactId> <artifactId>loan-broker</artifactId>
<version>2.1.0.BUILD-SNAPSHOT</version> <version>2.2.0.BUILD-SNAPSHOT</version>
<name>Samples (Applications) - Loan Broker</name> <name>Samples (Applications) - Loan Broker</name>
<properties> <properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<spring.integration.version>2.1.0.RELEASE</spring.integration.version> <spring.integration.version>2.2.0.RC3</spring.integration.version>
<commons-logging.version>1.1.1</commons-logging.version> <commons-logging.version>1.1.1</commons-logging.version>
<log4j.version>1.2.16</log4j.version> <log4j.version>1.2.17</log4j.version>
<junit.version>4.10</junit.version> <junit.version>4.10</junit.version>
</properties> </properties>
<dependencies> <dependencies>
@@ -41,13 +41,13 @@
<plugin> <plugin>
<groupId>org.apache.maven.plugins</groupId> <groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId> <artifactId>maven-compiler-plugin</artifactId>
<version>2.3.2</version> <version>2.5.1</version>
<configuration> <configuration>
<source>1.5</source> <source>1.6</source>
<target>1.5</target> <target>1.6</target>
<compilerArgument>-Xlint:all</compilerArgument> <compilerArgument>-Xlint:all</compilerArgument>
<showWarnings>true</showWarnings> <showWarnings>true</showWarnings>
<showDeprecation>false</showDeprecation> <showDeprecation>true</showDeprecation>
</configuration> </configuration>
</plugin> </plugin>
</plugins> </plugins>

View File

@@ -1,5 +1,5 @@
/* /*
* Copyright 2002-2010 the original author or authors. * Copyright 2002-2012 the original author or authors.
* *
* Licensed under the Apache License, Version 2.0 (the "License"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
@@ -24,19 +24,21 @@ import org.springframework.integration.samples.loanbroker.domain.LoanRequest;
/** /**
* POJI Gateway that connects method invocations to the request-channel. * POJI Gateway that connects method invocations to the request-channel.
* This completely isolates the developer from Spring Integration API details. * This completely isolates the developer from Spring Integration API details.
* *
* @author Oleg Zhurakousky * @author Oleg Zhurakousky
* @author Gunnar Hillert
*
*/ */
public interface LoanBrokerGateway { public interface LoanBrokerGateway {
/** /**
* Will return the best {@link LoanQuote} for the given request. * Will return the best {@link LoanQuote} for the given request.
*/ */
public LoanQuote getBestLoanQuote(LoanRequest loanRequest); LoanQuote getBestLoanQuote(LoanRequest loanRequest);
/** /**
* Will return all {@link LoanQuote}s for the given request. * Will return all {@link LoanQuote}s for the given request.
*/ */
public List<LoanQuote> getAllLoanQuotes(LoanRequest loanRequest); List<LoanQuote> getAllLoanQuotes(LoanRequest loanRequest);
} }

View File

@@ -1,3 +1,18 @@
/*
* Copyright 2002-2012 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.springframework.integration.samples.loanbroker.loanshark.domain; package org.springframework.integration.samples.loanbroker.loanshark.domain;
import java.util.ArrayList; import java.util.ArrayList;
@@ -24,151 +39,163 @@ import flexjson.JSONSerializer;
@Entity @Entity
public class LoanShark { public class LoanShark {
private String name; private String name;
private Long counter; private Long counter;
private Double averageRate; private Double averageRate;
public String toJson() { public String toJson() {
return new JSONSerializer().exclude("*.class").serialize(this); return new JSONSerializer().exclude("*.class").serialize(this);
} }
public static LoanShark fromJsonToLoanShark(String json) { public static LoanShark fromJsonToLoanShark(String json) {
return new JSONDeserializer<LoanShark>().use(null, LoanShark.class).deserialize(json); return new JSONDeserializer<LoanShark>().use(null, LoanShark.class).deserialize(json);
} }
public static String toJsonArray(Collection<LoanShark> collection) { public static String toJsonArray(Collection<LoanShark> collection) {
return new JSONSerializer().exclude("*.class").serialize(collection); return new JSONSerializer().exclude("*.class").serialize(collection);
} }
public static Collection<LoanShark> fromJsonArrayToLoanSharks(String json) { public static Collection<LoanShark> fromJsonArrayToLoanSharks(String json) {
return new JSONDeserializer<List<LoanShark>>().use(null, ArrayList.class).use("values", LoanShark.class).deserialize(json); return new JSONDeserializer<List<LoanShark>>().use(null, ArrayList.class).use("values", LoanShark.class).deserialize(json);
} }
@PersistenceContext @PersistenceContext
transient EntityManager entityManager; transient EntityManager entityManager;
@Id @Id
@GeneratedValue(strategy = GenerationType.AUTO) @GeneratedValue(strategy = GenerationType.AUTO)
@Column(name = "id") @Column(name = "id")
private Long id; private Long id;
@Version @Version
@Column(name = "version") @Column(name = "version")
private Integer version; private Integer version;
public Long getId() { public Long getId() {
return this.id; return this.id;
} }
public void setId(Long id) { public void setId(Long id) {
this.id = id; this.id = id;
} }
public Integer getVersion() { public Integer getVersion() {
return this.version; return this.version;
} }
public void setVersion(Integer version) { public void setVersion(Integer version) {
this.version = version; this.version = version;
} }
@Transactional @Transactional
public void persist() { public void persist() {
if (this.entityManager == null) this.entityManager = entityManager(); if (this.entityManager == null) {
this.entityManager.persist(this); this.entityManager = entityManager();
} }
this.entityManager.persist(this);
}
@Transactional @Transactional
public void remove() { public void remove() {
if (this.entityManager == null) this.entityManager = entityManager(); if (this.entityManager == null) {
if (this.entityManager.contains(this)) { this.entityManager = entityManager();
this.entityManager.remove(this); }
} else { if (this.entityManager.contains(this)) {
LoanShark attached = this.entityManager.find(this.getClass(), this.id); this.entityManager.remove(this);
this.entityManager.remove(attached); } else {
} LoanShark attached = this.entityManager.find(this.getClass(), this.id);
} this.entityManager.remove(attached);
}
}
@Transactional @Transactional
public void flush() { public void flush() {
if (this.entityManager == null) this.entityManager = entityManager(); if (this.entityManager == null) {
this.entityManager.flush(); this.entityManager = entityManager();
} }
this.entityManager.flush();
}
@Transactional @Transactional
public LoanShark merge() { public LoanShark merge() {
if (this.entityManager == null) this.entityManager = entityManager(); if (this.entityManager == null) {
LoanShark merged = this.entityManager.merge(this); this.entityManager = entityManager();
this.entityManager.flush(); }
return merged; LoanShark merged = this.entityManager.merge(this);
} this.entityManager.flush();
return merged;
}
public static final EntityManager entityManager() { public static final EntityManager entityManager() {
EntityManager em = new LoanShark().entityManager; EntityManager em = new LoanShark().entityManager;
if (em == null) throw new IllegalStateException("Entity manager has not been injected (is the Spring Aspects JAR configured as an AJC/AJDT aspects library?)"); if (em == null) {
return em; throw new IllegalStateException("Entity manager has not been injected (is the Spring Aspects JAR configured as an AJC/AJDT aspects library?)");
} }
return em;
}
public static long countLoanSharks() { public static long countLoanSharks() {
return ((Number) entityManager().createQuery("select count(o) from LoanShark o").getSingleResult()).longValue(); return ((Number) entityManager().createQuery("select count(o) from LoanShark o").getSingleResult()).longValue();
} }
@SuppressWarnings("unchecked") @SuppressWarnings("unchecked")
public static List<LoanShark> findAllLoanSharks() { public static List<LoanShark> findAllLoanSharks() {
return entityManager().createQuery("select o from LoanShark o").getResultList(); return entityManager().createQuery("select o from LoanShark o").getResultList();
} }
public static LoanShark findLoanShark(Long id) { public static LoanShark findLoanShark(Long id) {
if (id == null) return null; if (id == null) return null;
return entityManager().find(LoanShark.class, id); return entityManager().find(LoanShark.class, id);
} }
@SuppressWarnings("unchecked") @SuppressWarnings("unchecked")
public static List<LoanShark> findLoanSharkEntries(int firstResult, int maxResults) { public static List<LoanShark> findLoanSharkEntries(int firstResult, int maxResults) {
return entityManager().createQuery("select o from LoanShark o").setFirstResult(firstResult).setMaxResults(maxResults).getResultList(); return entityManager().createQuery("select o from LoanShark o").setFirstResult(firstResult).setMaxResults(maxResults).getResultList();
} }
public String getName() { public String getName() {
return this.name; return this.name;
} }
public void setName(String name) { public void setName(String name) {
this.name = name; this.name = name;
} }
public Long getCounter() { public Long getCounter() {
return this.counter; return this.counter;
} }
public void setCounter(Long counter) { public void setCounter(Long counter) {
this.counter = counter; this.counter = counter;
} }
public Double getAverageRate() { public Double getAverageRate() {
return this.averageRate; return this.averageRate;
} }
public void setAverageRate(Double averageRate) { public void setAverageRate(Double averageRate) {
this.averageRate = averageRate; this.averageRate = averageRate;
} }
public static Query findLoanSharksByName(String name) { public static Query findLoanSharksByName(String name) {
if (name == null || name.length() == 0) throw new IllegalArgumentException("The name argument is required"); if (name == null || name.length() == 0) {
EntityManager em = LoanShark.entityManager(); throw new IllegalArgumentException("The name argument is required");
Query q = em.createQuery("SELECT LoanShark FROM LoanShark AS loanshark WHERE loanshark.name = :name"); }
q.setParameter("name", name); EntityManager em = LoanShark.entityManager();
return q; Query q = em.createQuery("SELECT LoanShark FROM LoanShark AS loanshark WHERE loanshark.name = :name");
} q.setParameter("name", name);
return q;
}
public String toString() { public String toString() {
StringBuilder sb = new StringBuilder(); StringBuilder sb = new StringBuilder();
sb.append("Id: ").append(getId()).append(", "); sb.append("Id: ").append(getId()).append(", ");
sb.append("Version: ").append(getVersion()).append(", "); sb.append("Version: ").append(getVersion()).append(", ");
sb.append("Name: ").append(getName()).append(", "); sb.append("Name: ").append(getName()).append(", ");
sb.append("Counter: ").append(getCounter()).append(", "); sb.append("Counter: ").append(getCounter()).append(", ");
sb.append("AverageRate: ").append(getAverageRate()); sb.append("AverageRate: ").append(getAverageRate());
return sb.toString(); return sb.toString();
} }
} }

View File

@@ -1,3 +1,18 @@
/*
* Copyright 2002-2012 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.springframework.integration.samples.loanbroker.loanshark.web; package org.springframework.integration.samples.loanbroker.loanshark.web;
import javax.validation.Valid; import javax.validation.Valid;
@@ -24,115 +39,115 @@ import org.springframework.web.bind.annotation.ResponseBody;
public class SharkController { public class SharkController {
@RequestMapping(method = RequestMethod.POST) @RequestMapping(method = RequestMethod.POST)
public String create(@Valid LoanShark loanShark, BindingResult result, Model model) { public String create(@Valid LoanShark loanShark, BindingResult result, Model model) {
if (result.hasErrors()) { if (result.hasErrors()) {
model.addAttribute("loanShark", loanShark); model.addAttribute("loanShark", loanShark);
return "loansharks/create"; return "loansharks/create";
} }
loanShark.persist(); loanShark.persist();
return "redirect:/loansharks/" + loanShark.getId(); return "redirect:/loansharks/" + loanShark.getId();
} }
@RequestMapping(params = "form", method = RequestMethod.GET) @RequestMapping(params = "form", method = RequestMethod.GET)
public String createForm(Model model) { public String createForm(Model model) {
model.addAttribute("loanShark", new LoanShark()); model.addAttribute("loanShark", new LoanShark());
return "loansharks/create"; return "loansharks/create";
} }
@RequestMapping(value = "/{id}", method = RequestMethod.GET) @RequestMapping(value = "/{id}", method = RequestMethod.GET)
public String show(@PathVariable("id") Long id, Model model) { public String show(@PathVariable("id") Long id, Model model) {
model.addAttribute("loanshark", LoanShark.findLoanShark(id)); model.addAttribute("loanshark", LoanShark.findLoanShark(id));
model.addAttribute("itemId", id); model.addAttribute("itemId", id);
return "loansharks/show"; return "loansharks/show";
} }
@RequestMapping(method = RequestMethod.GET) @RequestMapping(method = RequestMethod.GET)
public String list(@RequestParam(value = "page", required = false) Integer page, @RequestParam(value = "size", required = false) Integer size, Model model) { public String list(@RequestParam(value = "page", required = false) Integer page, @RequestParam(value = "size", required = false) Integer size, Model model) {
if (page != null || size != null) { if (page != null || size != null) {
int sizeNo = size == null ? 10 : size.intValue(); int sizeNo = size == null ? 10 : size.intValue();
model.addAttribute("loansharks", LoanShark.findLoanSharkEntries(page == null ? 0 : (page.intValue() - 1) * sizeNo, sizeNo)); model.addAttribute("loansharks", LoanShark.findLoanSharkEntries(page == null ? 0 : (page.intValue() - 1) * sizeNo, sizeNo));
float nrOfPages = (float) LoanShark.countLoanSharks() / sizeNo; float nrOfPages = (float) LoanShark.countLoanSharks() / sizeNo;
model.addAttribute("maxPages", (int) ((nrOfPages > (int) nrOfPages || nrOfPages == 0.0) ? nrOfPages + 1 : nrOfPages)); model.addAttribute("maxPages", (int) ((nrOfPages > (int) nrOfPages || nrOfPages == 0.0) ? nrOfPages + 1 : nrOfPages));
} else { } else {
model.addAttribute("loansharks", LoanShark.findAllLoanSharks()); model.addAttribute("loansharks", LoanShark.findAllLoanSharks());
} }
return "loansharks/list"; return "loansharks/list";
} }
@RequestMapping(method = RequestMethod.PUT) @RequestMapping(method = RequestMethod.PUT)
public String update(@Valid LoanShark loanShark, BindingResult result, Model model) { public String update(@Valid LoanShark loanShark, BindingResult result, Model model) {
if (result.hasErrors()) { if (result.hasErrors()) {
model.addAttribute("loanShark", loanShark); model.addAttribute("loanShark", loanShark);
return "loansharks/update"; return "loansharks/update";
} }
loanShark.merge(); loanShark.merge();
return "redirect:/loansharks/" + loanShark.getId(); return "redirect:/loansharks/" + loanShark.getId();
} }
@RequestMapping(value = "/{id}", params = "form", method = RequestMethod.GET) @RequestMapping(value = "/{id}", params = "form", method = RequestMethod.GET)
public String updateForm(@PathVariable("id") Long id, Model model) { public String updateForm(@PathVariable("id") Long id, Model model) {
model.addAttribute("loanShark", LoanShark.findLoanShark(id)); model.addAttribute("loanShark", LoanShark.findLoanShark(id));
return "loansharks/update"; return "loansharks/update";
} }
@RequestMapping(value = "/{id}", method = RequestMethod.DELETE) @RequestMapping(value = "/{id}", method = RequestMethod.DELETE)
public String delete(@PathVariable("id") Long id, @RequestParam(value = "page", required = false) Integer page, @RequestParam(value = "size", required = false) Integer size, Model model) { public String delete(@PathVariable("id") Long id, @RequestParam(value = "page", required = false) Integer page, @RequestParam(value = "size", required = false) Integer size, Model model) {
LoanShark.findLoanShark(id).remove(); LoanShark.findLoanShark(id).remove();
model.addAttribute("page", (page == null) ? "1" : page.toString()); model.addAttribute("page", (page == null) ? "1" : page.toString());
model.addAttribute("size", (size == null) ? "10" : size.toString()); model.addAttribute("size", (size == null) ? "10" : size.toString());
return "redirect:/loansharks?page=" + ((page == null) ? "1" : page.toString()) + "&size=" + ((size == null) ? "10" : size.toString()); return "redirect:/loansharks?page=" + ((page == null) ? "1" : page.toString()) + "&size=" + ((size == null) ? "10" : size.toString());
} }
@RequestMapping(params = { "find=ByName", "form" }, method = RequestMethod.GET) @RequestMapping(params = { "find=ByName", "form" }, method = RequestMethod.GET)
public String findLoanSharksByNameForm(Model model) { public String findLoanSharksByNameForm(Model model) {
return "loansharks/findLoanSharksByName"; return "loansharks/findLoanSharksByName";
} }
@RequestMapping(params = "find=ByName", method = RequestMethod.GET) @RequestMapping(params = "find=ByName", method = RequestMethod.GET)
public String findLoanSharksByName(@RequestParam("name") String name, Model model) { public String findLoanSharksByName(@RequestParam("name") String name, Model model) {
model.addAttribute("loansharks", LoanShark.findLoanSharksByName(name).getResultList()); model.addAttribute("loansharks", LoanShark.findLoanSharksByName(name).getResultList());
return "loansharks/list"; return "loansharks/list";
} }
Converter<LoanShark, String> getLoanSharkConverter() { Converter<LoanShark, String> getLoanSharkConverter() {
return new Converter<LoanShark, String>() { return new Converter<LoanShark, String>() {
public String convert(LoanShark loanShark) { public String convert(LoanShark loanShark) {
return new StringBuilder().append(loanShark.getName()).append(" ").append(loanShark.getCounter()).append(" ").append(loanShark.getAverageRate()).toString(); return new StringBuilder().append(loanShark.getName()).append(" ").append(loanShark.getCounter()).append(" ").append(loanShark.getAverageRate()).toString();
} }
}; };
} }
@InitBinder @InitBinder
void registerConverters(WebDataBinder binder) { void registerConverters(WebDataBinder binder) {
if (binder.getConversionService() instanceof GenericConversionService) { if (binder.getConversionService() instanceof GenericConversionService) {
GenericConversionService conversionService = (GenericConversionService) binder.getConversionService(); GenericConversionService conversionService = (GenericConversionService) binder.getConversionService();
conversionService.addConverter(getLoanSharkConverter()); conversionService.addConverter(getLoanSharkConverter());
} }
} }
@RequestMapping(value = "/{id}", method = RequestMethod.GET, headers = "Accept=application/json") @RequestMapping(value = "/{id}", method = RequestMethod.GET, headers = "Accept=application/json")
@ResponseBody @ResponseBody
public String showJson(@PathVariable("id") Long id) { public String showJson(@PathVariable("id") Long id) {
return LoanShark.findLoanShark(id).toJson(); return LoanShark.findLoanShark(id).toJson();
} }
@RequestMapping(method = RequestMethod.POST, headers = "Accept=application/json") @RequestMapping(method = RequestMethod.POST, headers = "Accept=application/json")
public ResponseEntity<String> createFromJson(@RequestBody String json) { public ResponseEntity<String> createFromJson(@RequestBody String json) {
LoanShark.fromJsonToLoanShark(json).persist(); LoanShark.fromJsonToLoanShark(json).persist();
return new ResponseEntity<String>("LoanShark created", HttpStatus.CREATED); return new ResponseEntity<String>("LoanShark created", HttpStatus.CREATED);
} }
@RequestMapping(headers = "Accept=application/json") @RequestMapping(headers = "Accept=application/json")
@ResponseBody @ResponseBody
public String listJson() { public String listJson() {
return LoanShark.toJsonArray(LoanShark.findAllLoanSharks()); return LoanShark.toJsonArray(LoanShark.findAllLoanSharks());
} }
@RequestMapping(value = "/jsonArray", method = RequestMethod.POST, headers = "Accept=application/json") @RequestMapping(value = "/jsonArray", method = RequestMethod.POST, headers = "Accept=application/json")
public ResponseEntity<String> createFromJsonArray(@RequestBody String json) { public ResponseEntity<String> createFromJsonArray(@RequestBody String json) {
for (LoanShark loanshark: LoanShark.fromJsonArrayToLoanSharks(json)) { for (LoanShark loanshark: LoanShark.fromJsonArrayToLoanSharks(json)) {
loanshark.persist(); loanshark.persist();
} }
return new ResponseEntity<String>("LoanShark created", HttpStatus.CREATED); return new ResponseEntity<String>("LoanShark created", HttpStatus.CREATED);
} }
} }

View File

@@ -5,7 +5,7 @@
<modelVersion>4.0.0</modelVersion> <modelVersion>4.0.0</modelVersion>
<groupId>org.springframework.integration.samples</groupId> <groupId>org.springframework.integration.samples</groupId>
<artifactId>applications</artifactId> <artifactId>applications</artifactId>
<version>2.1.0.BUILD-SNAPSHOT</version> <version>2.2.0.BUILD-SNAPSHOT</version>
<name>Spring Integration Samples - Applications</name> <name>Spring Integration Samples - Applications</name>
<packaging>pom</packaging> <packaging>pom</packaging>

View File

@@ -4,16 +4,20 @@
<groupId>org.springframework.integration.samples</groupId> <groupId>org.springframework.integration.samples</groupId>
<artifactId>amqp</artifactId> <artifactId>amqp</artifactId>
<version>2.1.0.BUILD-SNAPSHOT</version> <version>2.2.0.BUILD-SNAPSHOT</version>
<packaging>jar</packaging> <packaging>jar</packaging>
<name>Samples (Basic) - AMQP</name> <name>Samples (Basic) - AMQP</name>
<url>http://www.springsource.org/spring-integration</url> <url>http://www.springsource.org/spring-integration</url>
<prerequisites>
<maven>2.2.1</maven>
</prerequisites>
<properties> <properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<spring.integration.version>2.1.0.RELEASE</spring.integration.version> <spring.integration.version>2.2.0.RC3</spring.integration.version>
<log4j.version>1.2.16</log4j.version> <log4j.version>1.2.17</log4j.version>
<junit.version>4.10</junit.version> <junit.version>4.10</junit.version>
</properties> </properties>
@@ -29,7 +33,7 @@
<plugins> <plugins>
<plugin> <plugin>
<artifactId>maven-eclipse-plugin</artifactId> <artifactId>maven-eclipse-plugin</artifactId>
<version>2.8</version> <version>2.9</version>
<configuration> <configuration>
<additionalProjectnatures> <additionalProjectnatures>
<projectnature>org.springframework.ide.eclipse.core.springnature</projectnature> <projectnature>org.springframework.ide.eclipse.core.springnature</projectnature>
@@ -44,7 +48,7 @@
<plugin> <plugin>
<groupId>org.apache.maven.plugins</groupId> <groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId> <artifactId>maven-compiler-plugin</artifactId>
<version>2.3.2</version> <version>2.5.1</version>
<configuration> <configuration>
<source>1.6</source> <source>1.6</source>
<target>1.6</target> <target>1.6</target>
@@ -56,7 +60,7 @@
<plugin> <plugin>
<groupId>org.codehaus.mojo</groupId> <groupId>org.codehaus.mojo</groupId>
<artifactId>exec-maven-plugin</artifactId> <artifactId>exec-maven-plugin</artifactId>
<version>1.2</version> <version>1.2.1</version>
<configuration> <configuration>
<mainClass>org.springframework.integration.samples.amqp.Main</mainClass> <mainClass>org.springframework.integration.samples.amqp.Main</mainClass>
</configuration> </configuration>

View File

@@ -1,7 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans" <beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:int="http://www.springframework.org/schema/integration"
xmlns:int="http://www.springframework.org/schema/integration"
xmlns:int-amqp="http://www.springframework.org/schema/integration/amqp" xmlns:int-amqp="http://www.springframework.org/schema/integration/amqp"
xmlns:rabbit="http://www.springframework.org/schema/rabbit" xmlns:rabbit="http://www.springframework.org/schema/rabbit"
xmlns:int-stream="http://www.springframework.org/schema/integration/stream" xmlns:int-stream="http://www.springframework.org/schema/integration/stream"
@@ -10,49 +9,51 @@
http://www.springframework.org/schema/integration/stream http://www.springframework.org/schema/integration/stream/spring-integration-stream.xsd http://www.springframework.org/schema/integration/stream http://www.springframework.org/schema/integration/stream/spring-integration-stream.xsd
http://www.springframework.org/schema/rabbit http://www.springframework.org/schema/rabbit/spring-rabbit.xsd http://www.springframework.org/schema/rabbit http://www.springframework.org/schema/rabbit/spring-rabbit.xsd
http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd"> http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd">
<!-- From STDIN To RabbitMQ -->
<int-stream:stdin-channel-adapter id="consoleIn" channel="toRabbit" > <!-- From STDIN To RabbitMQ -->
<int:poller fixed-delay="1000" max-messages-per-poll="1" />
</int-stream:stdin-channel-adapter>
<int:channel id="toRabbit" /> <int-stream:stdin-channel-adapter id="consoleIn"
channel="toRabbit">
<int:poller fixed-delay="1000" max-messages-per-poll="1" />
</int-stream:stdin-channel-adapter>
<int-amqp:outbound-channel-adapter channel="toRabbit" <int:channel id="toRabbit" />
amqp-template="amqpTemplate" exchange-name="si.test.exchange"
routing-key="si.test.binding"/>
<!-- From RabbitMQ To STDOUT --> <int-amqp:outbound-channel-adapter
channel="toRabbit" amqp-template="amqpTemplate" exchange-name="si.test.exchange"
routing-key="si.test.binding" />
<int-amqp:inbound-channel-adapter channel="fromRabbit" <!-- From RabbitMQ To STDOUT -->
queue-names="si.test.queue"
connection-factory="connectionFactory" />
<int:channel id="fromRabbit"> <int-amqp:inbound-channel-adapter channel="fromRabbit"
<int:interceptors> queue-names="si.test.queue" connection-factory="connectionFactory" />
<int:wire-tap channel="loggingChannel"/>
</int:interceptors>
</int:channel>
<int-stream:stdout-channel-adapter id="consoleOut" channel="fromRabbit" append-newline="true"/>
<int:logging-channel-adapter id="loggingChannel" log-full-message="true" level="INFO"/>
<!-- Infrastructure --> <int:channel id="fromRabbit">
<int:interceptors>
<int:wire-tap channel="loggingChannel" />
</int:interceptors>
</int:channel>
<rabbit:connection-factory id="connectionFactory" /> <int-stream:stdout-channel-adapter id="consoleOut" channel="fromRabbit"
append-newline="true" />
<rabbit:template id="amqpTemplate" connection-factory="connectionFactory" /> <int:logging-channel-adapter id="loggingChannel" log-full-message="true"
level="INFO" />
<rabbit:admin connection-factory="connectionFactory" /> <!-- Infrastructure -->
<rabbit:queue name="si.test.queue" /> <rabbit:connection-factory id="connectionFactory" />
<rabbit:direct-exchange name="si.test.exchange"> <rabbit:template id="amqpTemplate" connection-factory="connectionFactory" />
<rabbit:bindings>
<rabbit:binding queue="si.test.queue" key="si.test.binding" /> <rabbit:admin connection-factory="connectionFactory" />
</rabbit:bindings>
</rabbit:direct-exchange> <rabbit:queue name="si.test.queue" />
<rabbit:direct-exchange name="si.test.exchange">
<rabbit:bindings>
<rabbit:binding queue="si.test.queue" key="si.test.binding" />
</rabbit:bindings>
</rabbit:direct-exchange>
</beans> </beans>

View File

@@ -4,13 +4,18 @@
<modelVersion>4.0.0</modelVersion> <modelVersion>4.0.0</modelVersion>
<groupId>org.springframework.integration.samples</groupId> <groupId>org.springframework.integration.samples</groupId>
<artifactId>control-bus</artifactId> <artifactId>control-bus</artifactId>
<version>2.1.0.BUILD-SNAPSHOT</version> <version>2.2.0.BUILD-SNAPSHOT</version>
<name>Samples (Basic) - Control Bus</name> <name>Samples (Basic) - Control Bus</name>
<packaging>jar</packaging> <packaging>jar</packaging>
<prerequisites>
<maven>2.2.1</maven>
</prerequisites>
<properties> <properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<spring.integration.version>2.1.0.RELEASE</spring.integration.version> <spring.integration.version>2.2.0.RC3</spring.integration.version>
<log4j.version>1.2.16</log4j.version> <log4j.version>1.2.17</log4j.version>
<junit.version>4.10</junit.version> <junit.version>4.10</junit.version>
</properties> </properties>
<dependencies> <dependencies>
@@ -36,13 +41,13 @@
<plugin> <plugin>
<groupId>org.apache.maven.plugins</groupId> <groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId> <artifactId>maven-compiler-plugin</artifactId>
<version>2.3.2</version> <version>2.5.1</version>
<configuration> <configuration>
<source>1.5</source> <source>1.6</source>
<target>1.5</target> <target>1.6</target>
<compilerArgument>-Xlint:all</compilerArgument> <compilerArgument>-Xlint:all</compilerArgument>
<showWarnings>true</showWarnings> <showWarnings>true</showWarnings>
<showDeprecation>false</showDeprecation> <showDeprecation>true</showDeprecation>
</configuration> </configuration>
</plugin> </plugin>
</plugins> </plugins>

View File

@@ -4,16 +4,20 @@
<groupId>org.springframework.integration.samples</groupId> <groupId>org.springframework.integration.samples</groupId>
<artifactId>enricher</artifactId> <artifactId>enricher</artifactId>
<version>2.1.0.BUILD-SNAPSHOT</version> <version>2.2.0.BUILD-SNAPSHOT</version>
<packaging>jar</packaging> <packaging>jar</packaging>
<name>Samples (Basic) - Enricher</name> <name>Samples (Basic) - Enricher</name>
<url>http://www.springsource.org/spring-integration</url> <url>http://www.springsource.org/spring-integration</url>
<prerequisites>
<maven>2.2.1</maven>
</prerequisites>
<properties> <properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<spring.integration.version>2.1.0.RELEASE</spring.integration.version> <spring.integration.version>2.2.0.RC3</spring.integration.version>
<log4j.version>1.2.16</log4j.version> <log4j.version>1.2.17</log4j.version>
<junit.version>4.10</junit.version> <junit.version>4.10</junit.version>
</properties> </properties>
@@ -29,7 +33,7 @@
<plugins> <plugins>
<plugin> <plugin>
<artifactId>maven-eclipse-plugin</artifactId> <artifactId>maven-eclipse-plugin</artifactId>
<version>2.8</version> <version>2.9</version>
<configuration> <configuration>
<additionalProjectnatures> <additionalProjectnatures>
<projectnature>org.springframework.ide.eclipse.core.springnature</projectnature> <projectnature>org.springframework.ide.eclipse.core.springnature</projectnature>
@@ -44,7 +48,7 @@
<plugin> <plugin>
<groupId>org.apache.maven.plugins</groupId> <groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId> <artifactId>maven-compiler-plugin</artifactId>
<version>2.3.2</version> <version>2.5.1</version>
<configuration> <configuration>
<source>1.6</source> <source>1.6</source>
<target>1.6</target> <target>1.6</target>
@@ -56,7 +60,7 @@
<plugin> <plugin>
<groupId>org.codehaus.mojo</groupId> <groupId>org.codehaus.mojo</groupId>
<artifactId>exec-maven-plugin</artifactId> <artifactId>exec-maven-plugin</artifactId>
<version>1.2</version> <version>1.2.1</version>
<configuration> <configuration>
<mainClass>org.springframework.integration.samples.enricher.Main</mainClass> <mainClass>org.springframework.integration.samples.enricher.Main</mainClass>
</configuration> </configuration>
@@ -96,7 +100,7 @@
<dependency> <dependency>
<groupId>com.h2database</groupId> <groupId>com.h2database</groupId>
<artifactId>h2</artifactId> <artifactId>h2</artifactId>
<version>1.3.162</version> <version>1.3.168</version>
</dependency> </dependency>
</dependencies> </dependencies>

View File

@@ -1,14 +1,19 @@
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion> <modelVersion>4.0.0</modelVersion>
<groupId>org.springframework.integration.samples</groupId> <groupId>org.springframework.integration.samples</groupId>
<artifactId>feed</artifactId> <artifactId>feed</artifactId>
<version>2.1.0.BUILD-SNAPSHOT</version> <version>2.2.0.BUILD-SNAPSHOT</version>
<name>Samples (Basic) - Feed Demo (RSS/ATOM)</name> <name>Samples (Basic) - Feed Demo (RSS/ATOM)</name>
<packaging>jar</packaging> <packaging>jar</packaging>
<prerequisites>
<maven>2.2.1</maven>
</prerequisites>
<properties> <properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<spring.integration.version>2.1.0.RELEASE</spring.integration.version> <spring.integration.version>2.2.0.RC2</spring.integration.version>
<log4j.version>1.2.16</log4j.version> <log4j.version>1.2.17</log4j.version>
<junit.version>4.10</junit.version> <junit.version>4.10</junit.version>
</properties> </properties>
<dependencies> <dependencies>
@@ -34,13 +39,13 @@
<plugin> <plugin>
<groupId>org.apache.maven.plugins</groupId> <groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId> <artifactId>maven-compiler-plugin</artifactId>
<version>2.3.2</version> <version>2.5.1</version>
<configuration> <configuration>
<source>1.5</source> <source>1.6</source>
<target>1.5</target> <target>1.6</target>
<compilerArgument>-Xlint:all</compilerArgument> <compilerArgument>-Xlint:all</compilerArgument>
<showWarnings>true</showWarnings> <showWarnings>true</showWarnings>
<showDeprecation>false</showDeprecation> <showDeprecation>true</showDeprecation>
</configuration> </configuration>
</plugin> </plugin>
</plugins> </plugins>

View File

@@ -11,8 +11,8 @@
<maven>2.2.1</maven> <maven>2.2.1</maven>
</prerequisites> </prerequisites>
<properties> <properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<spring.integration.version>2.2.0.RC2</spring.integration.version> <spring.integration.version>2.2.0.RC3</spring.integration.version>
<log4j.version>1.2.17</log4j.version> <log4j.version>1.2.17</log4j.version>
<junit.version>4.10</junit.version> <junit.version>4.10</junit.version>
</properties> </properties>

View File

@@ -3,13 +3,18 @@
<modelVersion>4.0.0</modelVersion> <modelVersion>4.0.0</modelVersion>
<groupId>org.springframework.integration.samples</groupId> <groupId>org.springframework.integration.samples</groupId>
<artifactId>ftp</artifactId> <artifactId>ftp</artifactId>
<version>2.1.0.BUILD-SNAPSHOT</version> <version>2.2.0.BUILD-SNAPSHOT</version>
<name>Samples (Basic) - FTP Demo</name> <name>Samples (Basic) - FTP Demo</name>
<packaging>jar</packaging> <packaging>jar</packaging>
<prerequisites>
<maven>2.2.1</maven>
</prerequisites>
<properties> <properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<spring.integration.version>2.2.0.M1</spring.integration.version> <spring.integration.version>2.2.0.RC3</spring.integration.version>
<log4j.version>1.2.16</log4j.version> <log4j.version>1.2.17</log4j.version>
<junit.version>4.10</junit.version> <junit.version>4.10</junit.version>
</properties> </properties>
<dependencies> <dependencies>
@@ -22,7 +27,7 @@
<dependency> <dependency>
<groupId>commons-io</groupId> <groupId>commons-io</groupId>
<artifactId>commons-io</artifactId> <artifactId>commons-io</artifactId>
<version>2.1</version> <version>2.4</version>
</dependency> </dependency>
<!-- test-scoped dependencies --> <!-- test-scoped dependencies -->
@@ -57,13 +62,13 @@
<plugin> <plugin>
<groupId>org.apache.maven.plugins</groupId> <groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId> <artifactId>maven-compiler-plugin</artifactId>
<version>2.3.2</version> <version>2.5.1</version>
<configuration> <configuration>
<source>1.5</source> <source>1.6</source>
<target>1.5</target> <target>1.6</target>
<compilerArgument>-Xlint:all</compilerArgument> <compilerArgument>-Xlint:all</compilerArgument>
<showWarnings>true</showWarnings> <showWarnings>true</showWarnings>
<showDeprecation>false</showDeprecation> <showDeprecation>true</showDeprecation>
</configuration> </configuration>
</plugin> </plugin>
<plugin> <plugin>

View File

@@ -4,7 +4,7 @@
xmlns:context="http://www.springframework.org/schema/context" xmlns:context="http://www.springframework.org/schema/context"
xmlns:int="http://www.springframework.org/schema/integration" xmlns:int="http://www.springframework.org/schema/integration"
xmlns:int-ftp="http://www.springframework.org/schema/integration/ftp" xmlns:int-ftp="http://www.springframework.org/schema/integration/ftp"
xsi:schemaLocation="http://www.springframework.org/schema/integration/ftp http://www.springframework.org/schema/integration/ftp/spring-integration-ftp-2.1.xsd xsi:schemaLocation="http://www.springframework.org/schema/integration/ftp http://www.springframework.org/schema/integration/ftp/spring-integration-ftp.xsd
http://www.springframework.org/schema/integration http://www.springframework.org/schema/integration/spring-integration.xsd http://www.springframework.org/schema/integration http://www.springframework.org/schema/integration/spring-integration.xsd
http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context.xsd"> http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context.xsd">
@@ -29,12 +29,12 @@
command-options="" command-options=""
expression="payload" expression="payload"
reply-channel="toSplitter"/> reply-channel="toSplitter"/>
<int:channel id="toSplitter"> <int:channel id="toSplitter">
<int:interceptors> <int:interceptors>
<int:wire-tap channel="logger"/> <int:wire-tap channel="logger"/>
</int:interceptors> </int:interceptors>
</int:channel> </int:channel>
<int:logging-channel-adapter id="logger" log-full-message="true"/> <int:logging-channel-adapter id="logger" log-full-message="true"/>
@@ -45,25 +45,25 @@
session-factory="ftpSessionFactory" session-factory="ftpSessionFactory"
request-channel="toGet" request-channel="toGet"
reply-channel="toRemoveChannel" reply-channel="toRemoveChannel"
command="get" command="get"
command-options="-P" command-options="-P"
expression="payload.remoteDirectory + '/' + payload.filename"/> expression="payload.remoteDirectory + '/' + payload.filename"/>
<int:channel id="toRemoveChannel"> <int:channel id="toRemoveChannel">
<int:interceptors> <int:interceptors>
<int:wire-tap channel="logger2"/> <int:wire-tap channel="logger2"/>
</int:interceptors> </int:interceptors>
</int:channel> </int:channel>
<int:logging-channel-adapter id="logger2" log-full-message="true"/> <int:logging-channel-adapter id="logger2" log-full-message="true"/>
<int-ftp:outbound-gateway id="gatewayRM" <int-ftp:outbound-gateway id="gatewayRM"
session-factory="ftpSessionFactory" cache-sessions="false" session-factory="ftpSessionFactory" cache-sessions="false"
expression="headers['file_remoteDirectory'] + '/' + headers['file_remoteFile']" expression="headers['file_remoteDirectory'] + '/' + headers['file_remoteFile']"
request-channel="toRemoveChannel" request-channel="toRemoveChannel"
command="rm" command="rm"
reply-channel="aggregateResultsChannel"/> reply-channel="aggregateResultsChannel"/>
<int:aggregator input-channel="aggregateResultsChannel"/> <int:aggregator input-channel="aggregateResultsChannel"/>
</beans> </beans>

View File

@@ -4,30 +4,35 @@
<modelVersion>4.0.0</modelVersion> <modelVersion>4.0.0</modelVersion>
<groupId>org.springframework.integration.samples</groupId> <groupId>org.springframework.integration.samples</groupId>
<artifactId>helloworld</artifactId> <artifactId>helloworld</artifactId>
<version>2.1.0.BUILD-SNAPSHOT</version> <version>2.2.0.BUILD-SNAPSHOT</version>
<name>Samples (Basic) - Hello World Sample</name> <name>Samples (Basic) - Hello World Sample</name>
<packaging>jar</packaging> <packaging>jar</packaging>
<prerequisites>
<maven>2.2.1</maven>
</prerequisites>
<properties> <properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<spring.integration.version>2.1.0.RELEASE</spring.integration.version> <spring.integration.version>2.2.0.RC3</spring.integration.version>
<log4j.version>1.2.16</log4j.version> <log4j.version>1.2.17</log4j.version>
<junit.version>4.10</junit.version> <junit.version>4.10</junit.version>
<java.main.class>org.springframework.integration.samples.helloworld.HelloWorldApp</java.main.class> <java.main.class>org.springframework.integration.samples.helloworld.HelloWorldApp</java.main.class>
</properties> </properties>
<profiles> <profiles>
<profile> <profile>
<id>hello</id> <id>hello</id>
<properties> <properties>
<java.main.class>org.springframework.integration.samples.helloworld.HelloWorldApp</java.main.class> <java.main.class>org.springframework.integration.samples.helloworld.HelloWorldApp</java.main.class>
</properties> </properties>
</profile> </profile>
<profile> <profile>
<id>poller</id> <id>poller</id>
<properties> <properties>
<java.main.class>org.springframework.integration.samples.helloworld.PollerApp</java.main.class> <java.main.class>org.springframework.integration.samples.helloworld.PollerApp</java.main.class>
</properties> </properties>
</profile> </profile>
</profiles> </profiles>
<dependencies> <dependencies>
@@ -53,19 +58,19 @@
<plugin> <plugin>
<groupId>org.apache.maven.plugins</groupId> <groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId> <artifactId>maven-compiler-plugin</artifactId>
<version>2.3.2</version> <version>2.5.1</version>
<configuration> <configuration>
<source>1.5</source> <source>1.6</source>
<target>1.5</target> <target>1.6</target>
<compilerArgument>-Xlint:all</compilerArgument> <compilerArgument>-Xlint:all</compilerArgument>
<showWarnings>true</showWarnings> <showWarnings>true</showWarnings>
<showDeprecation>false</showDeprecation> <showDeprecation>true</showDeprecation>
</configuration> </configuration>
</plugin> </plugin>
<plugin> <plugin>
<groupId>org.codehaus.mojo</groupId> <groupId>org.codehaus.mojo</groupId>
<artifactId>exec-maven-plugin</artifactId> <artifactId>exec-maven-plugin</artifactId>
<version>1.2</version> <version>1.2.1</version>
<configuration> <configuration>
<mainClass>${java.main.class}</mainClass> <mainClass>${java.main.class}</mainClass>
</configuration> </configuration>

View File

@@ -3,16 +3,21 @@
<modelVersion>4.0.0</modelVersion> <modelVersion>4.0.0</modelVersion>
<groupId>org.springframework.integration.samples</groupId> <groupId>org.springframework.integration.samples</groupId>
<artifactId>http</artifactId> <artifactId>http</artifactId>
<version>2.1.0.BUILD-SNAPSHOT</version> <version>2.2.0.BUILD-SNAPSHOT</version>
<name>Samples (Basic) - HTTP Demo</name> <name>Samples (Basic) - HTTP Demo</name>
<packaging>war</packaging> <packaging>war</packaging>
<prerequisites>
<maven>2.2.1</maven>
</prerequisites>
<properties> <properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<spring.integration.version>2.1.0.RELEASE</spring.integration.version> <spring.integration.version>2.2.0.RC3</spring.integration.version>
<spring.version>3.1.0.RELEASE</spring.version> <spring.version>3.1.3.RELEASE</spring.version>
<commons-fileupload>1.2</commons-fileupload> <commons-fileupload>1.2.2</commons-fileupload>
<commons-io>1.3.2</commons-io> <commons-io>1.3.2</commons-io>
<log4j.version>1.2.16</log4j.version> <log4j.version>1.2.17</log4j.version>
</properties> </properties>
<dependencies> <dependencies>
<dependency> <dependency>
@@ -43,7 +48,7 @@
<dependency> <dependency>
<groupId>javax.mail</groupId> <groupId>javax.mail</groupId>
<artifactId>mail</artifactId> <artifactId>mail</artifactId>
<version>1.4.1</version> <version>1.4.5</version>
</dependency> </dependency>
<dependency> <dependency>
<groupId>log4j</groupId> <groupId>log4j</groupId>
@@ -56,19 +61,19 @@
<plugin> <plugin>
<groupId>org.apache.maven.plugins</groupId> <groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId> <artifactId>maven-compiler-plugin</artifactId>
<version>2.3.2</version> <version>2.5.1</version>
<configuration> <configuration>
<source>1.5</source> <source>1.6</source>
<target>1.5</target> <target>1.6</target>
<compilerArgument>-Xlint:all</compilerArgument> <compilerArgument>-Xlint:all</compilerArgument>
<showWarnings>true</showWarnings> <showWarnings>true</showWarnings>
<showDeprecation>false</showDeprecation> <showDeprecation>true</showDeprecation>
</configuration> </configuration>
</plugin> </plugin>
<plugin> <plugin>
<groupId>org.codehaus.mojo</groupId> <groupId>org.codehaus.mojo</groupId>
<artifactId>exec-maven-plugin</artifactId> <artifactId>exec-maven-plugin</artifactId>
<version>1.2</version> <version>1.2.1</version>
<configuration> <configuration>
<mainClass>org.springframework.integration.samples.http.HttpClientDemo</mainClass> <mainClass>org.springframework.integration.samples.http.HttpClientDemo</mainClass>
</configuration> </configuration>
@@ -76,7 +81,7 @@
<plugin> <plugin>
<groupId>org.mortbay.jetty</groupId> <groupId>org.mortbay.jetty</groupId>
<artifactId>maven-jetty-plugin</artifactId> <artifactId>maven-jetty-plugin</artifactId>
<version>6.1.10</version> <version>6.1.26</version>
</plugin> </plugin>
</plugins> </plugins>
</build> </build>

View File

@@ -1,5 +1,5 @@
/* /*
* Copyright 2002-2011 the original author or authors. * Copyright 2002-2012 the original author or authors.
* *
* Licensed under the Apache License, Version 2.0 (the "License"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
@@ -18,9 +18,11 @@ package org.springframework.integration.samples.http;
/** /**
* @author Oleg Zhurakousky * @author Oleg Zhurakousky
* @author Gunnar Hillert
* *
*/ */
public interface RequestGateway { public interface RequestGateway {
public String echo(String request); String echo(String request);
} }

View File

@@ -1,23 +1,19 @@
Spring Integration - JDBC Sample Spring Integration - JDBC Sample
================================ ================================
# Overview ## Overview
This sample provides example of how the Jdbc Adapters can be used. This sample provides example of how the JDBC Adapters can be used.
The example presented covers the following use cases The example presented covers the following use cases
* Find a Person detail from the database based on the name provided * Find a Person detail from the database based on the name provided
* Create a new Person record in the table * Create a new Person record in the table
The first example demonstrates the use of outbound gateway to search for a person record using the The first example demonstrates the use of *Outbound Gateway* to search for a person record using *Spring Integration*'s *JDBC Outbound Gateway*.
spring integration's jdbc outbound gateway
The second example on other hand demonstrates how the jdbc outbound gateway be used to create a new The second example on other hand demonstrates how the *JDBC Outbound Gateway* can be used to create a new *Person* record and then return the newly created *Person* record. This example demonstrates how to make use of the sql parameter source factory to extract the required values to be inserted/updated/selected in the query provided.
Person record and then return the newly created Person record.
This example demonstrates how to make use of the sql parameter source factory to extract
the required values to be inserted/updated/selected in the query provided.
# Getting Started ## Getting Started
You can run the application by either You can run the application by either
@@ -26,18 +22,18 @@ You can run the application by either
- mvn package - mvn package
- mvn exec:java - mvn exec:java
Make an appropriate choice for searching a Person or creating a Person Make an appropriate choice for searching a Person or creating a Person.
For creating the person record, select the appropriate steps as prompted by the application For creating the person record, select the appropriate steps as prompted by the application.
On creation of Person records, you may choose the option of selecting the created person records and view their details On creation of *Person* records, you may choose the option of selecting the created person records and view their details.
#Some details about the sample "Person Outbound Gateway" ## Details
We use the outbound gateway to insert records in a Person table based on the values contained We use the outbound gateway to insert records in a Person table based on the values contained
in the message payload that is received over the channel to the adapter. in the message payload that is received over the channel to the adapter.
The following are used to configure the gateway The following are used to configure the *Gateway*:
* The request and reply channels * The request and reply channels
* The data source for the database * The data source for the database
@@ -47,7 +43,7 @@ The following are used to configure the gateway
* Optional reply SQL Parameter source factory * Optional reply SQL Parameter source factory
* RowMapper if you intend to map the ResultSet to your custom object * RowMapper if you intend to map the ResultSet to your custom object
The following sequence of events happen when we invoke the createPerson method on the gateway The following sequence of events happen when we invoke the *createPerson* method on the *Gateway*:
* The parameter of type Person is sent as a payload of a message over the reply-channel * The parameter of type Person is sent as a payload of a message over the reply-channel
* The outbound gateway reads this message and extracts the payload * The outbound gateway reads this message and extracts the payload
@@ -61,10 +57,12 @@ The following sequence of events happen when we invoke the createPerson method o
* The Person object is then sent as a payload of the Message over the reply channel. * The Person object is then sent as a payload of the Message over the reply channel.
* The Person payload is extracted from the Message and returned to the calling application. * The Person payload is extracted from the Message and returned to the calling application.
For executing the program and see the results, execute the junit test case ## Running the Sample
org.springframework.integration.samples.jdbc.OutboundGatewayTest
# Resources For executing the program and see the results, execute the junit test case
**org.springframework.integration.samples.jdbc.OutboundGatewayTest**
## Resources
For help please take a look at the Spring Integration documentation: For help please take a look at the Spring Integration documentation:

View File

@@ -4,16 +4,20 @@
<groupId>org.springframework.integration.samples</groupId> <groupId>org.springframework.integration.samples</groupId>
<artifactId>jdbc</artifactId> <artifactId>jdbc</artifactId>
<version>2.1.0.BUILD-SNAPSHOT</version> <version>2.2.0.BUILD-SNAPSHOT</version>
<packaging>jar</packaging> <packaging>jar</packaging>
<name>Samples (Basic) - JDBC</name> <name>Samples (Basic) - JDBC</name>
<url>http://www.springsource.org/spring-integration</url> <url>http://www.springsource.org/spring-integration</url>
<prerequisites>
<maven>2.2.1</maven>
</prerequisites>
<properties> <properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<spring.integration.version>2.1.0.RELEASE</spring.integration.version> <spring.integration.version>2.2.0.RC3</spring.integration.version>
<log4j.version>1.2.16</log4j.version> <log4j.version>1.2.17</log4j.version>
<junit.version>4.10</junit.version> <junit.version>4.10</junit.version>
</properties> </properties>
@@ -29,7 +33,7 @@
<plugins> <plugins>
<plugin> <plugin>
<artifactId>maven-eclipse-plugin</artifactId> <artifactId>maven-eclipse-plugin</artifactId>
<version>2.8</version> <version>2.9</version>
<configuration> <configuration>
<additionalProjectnatures> <additionalProjectnatures>
<projectnature>org.springframework.ide.eclipse.core.springnature</projectnature> <projectnature>org.springframework.ide.eclipse.core.springnature</projectnature>
@@ -44,7 +48,7 @@
<plugin> <plugin>
<groupId>org.apache.maven.plugins</groupId> <groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId> <artifactId>maven-compiler-plugin</artifactId>
<version>2.3.2</version> <version>2.5.1</version>
<configuration> <configuration>
<source>1.6</source> <source>1.6</source>
<target>1.6</target> <target>1.6</target>
@@ -56,7 +60,7 @@
<plugin> <plugin>
<groupId>org.codehaus.mojo</groupId> <groupId>org.codehaus.mojo</groupId>
<artifactId>exec-maven-plugin</artifactId> <artifactId>exec-maven-plugin</artifactId>
<version>1.2</version> <version>1.2.1</version>
<configuration> <configuration>
<mainClass>org.springframework.integration.samples.jdbc.Main</mainClass> <mainClass>org.springframework.integration.samples.jdbc.Main</mainClass>
</configuration> </configuration>
@@ -102,7 +106,7 @@
<dependency> <dependency>
<groupId>com.h2database</groupId> <groupId>com.h2database</groupId>
<artifactId>h2</artifactId> <artifactId>h2</artifactId>
<version>1.3.162</version> <version>1.3.168</version>
</dependency> </dependency>
</dependencies> </dependencies>
</project> </project>

View File

@@ -80,14 +80,15 @@ public final class Main {
System.out.print("Enter you choice: "); System.out.print("Enter you choice: ");
while (true) { while (true) {
final String input = scanner.nextLine(); final String input = scanner.nextLine();
if("1".equals(input.trim())) if("1".equals(input.trim())) {
getPersonDetails(scanner, personService); getPersonDetails(scanner, personService);
else if("2".equals(input.trim())) } else if("2".equals(input.trim())) {
createPersonDetails(scanner,personService); createPersonDetails(scanner,personService);
else if("q".equals(input.trim())) } else if("q".equals(input.trim())) {
break; break;
else } else {
System.out.println("Invalid choice\n\n"); System.out.println("Invalid choice\n\n");
}
System.out.println("Please enter a choice and press <enter>: "); System.out.println("Please enter a choice and press <enter>: ");
System.out.println("\t1. Find person details"); System.out.println("\t1. Find person details");

View File

@@ -4,24 +4,29 @@
<modelVersion>4.0.0</modelVersion> <modelVersion>4.0.0</modelVersion>
<groupId>org.springframework.integration.samples</groupId> <groupId>org.springframework.integration.samples</groupId>
<artifactId>jms</artifactId> <artifactId>jms</artifactId>
<version>2.1.0.BUILD-SNAPSHOT</version> <version>2.2.0.BUILD-SNAPSHOT</version>
<name>Samples (Basic) - JMS</name> <name>Samples (Basic) - JMS</name>
<packaging>jar</packaging> <packaging>jar</packaging>
<prerequisites>
<maven>2.2.1</maven>
</prerequisites>
<properties> <properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<spring.integration.version>2.1.0.RELEASE</spring.integration.version> <spring.integration.version>2.2.0.RC3</spring.integration.version>
<activemq.version>5.5.1</activemq.version> <activemq.version>5.7.0</activemq.version>
<slf4j.version>1.6.4</slf4j.version> <slf4j.version>1.7.2</slf4j.version>
<junit.version>4.10</junit.version> <junit.version>4.10</junit.version>
</properties> </properties>
<dependencies> <dependencies>
<dependency> <dependency>
<groupId>junit</groupId> <groupId>junit</groupId>
<artifactId>junit</artifactId> <artifactId>junit</artifactId>
<version>${junit.version}</version> <version>${junit.version}</version>
<scope>test</scope> <scope>test</scope>
</dependency> </dependency>
<dependency> <dependency>
<groupId>org.apache.activemq</groupId> <groupId>org.apache.activemq</groupId>
@@ -38,33 +43,33 @@
</exclusion> </exclusion>
</exclusions> </exclusions>
</dependency> </dependency>
<dependency> <dependency>
<groupId>org.springframework</groupId> <groupId>org.springframework</groupId>
<artifactId>spring-jms</artifactId> <artifactId>spring-jms</artifactId>
<version>3.1.0.RELEASE</version> <version>3.1.3.RELEASE</version>
<scope>compile</scope> <scope>compile</scope>
</dependency> </dependency>
<dependency> <dependency>
<groupId>org.springframework.integration</groupId> <groupId>org.springframework.integration</groupId>
<artifactId>spring-integration-core</artifactId> <artifactId>spring-integration-core</artifactId>
<version>${spring.integration.version}</version> <version>${spring.integration.version}</version>
</dependency> </dependency>
<dependency> <dependency>
<groupId>org.springframework.integration</groupId> <groupId>org.springframework.integration</groupId>
<artifactId>spring-integration-jms</artifactId> <artifactId>spring-integration-jms</artifactId>
<version>${spring.integration.version}</version> <version>${spring.integration.version}</version>
</dependency> </dependency>
<dependency> <dependency>
<groupId>org.springframework.integration</groupId> <groupId>org.springframework.integration</groupId>
<artifactId>spring-integration-stream</artifactId> <artifactId>spring-integration-stream</artifactId>
<version>${spring.integration.version}</version> <version>${spring.integration.version}</version>
</dependency> </dependency>
<dependency> <dependency>
<groupId>org.slf4j</groupId> <groupId>org.slf4j</groupId>
<artifactId>slf4j-log4j12</artifactId> <artifactId>slf4j-log4j12</artifactId>
<version>${slf4j.version}</version> <version>${slf4j.version}</version>
</dependency> </dependency>
</dependencies> </dependencies>
<build> <build>
@@ -72,13 +77,13 @@
<plugin> <plugin>
<groupId>org.apache.maven.plugins</groupId> <groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId> <artifactId>maven-compiler-plugin</artifactId>
<version>2.3.2</version> <version>2.5.1</version>
<configuration> <configuration>
<source>1.5</source> <source>1.6</source>
<target>1.5</target> <target>1.6</target>
<compilerArgument>-Xlint:all</compilerArgument> <compilerArgument>-Xlint:all</compilerArgument>
<showWarnings>true</showWarnings> <showWarnings>true</showWarnings>
<showDeprecation>false</showDeprecation> <showDeprecation>true</showDeprecation>
</configuration> </configuration>
</plugin> </plugin>
</plugins> </plugins>

View File

@@ -1,5 +1,5 @@
/* /*
* Copyright 2002-2010 the original author or authors. * Copyright 2002-2012 the original author or authors.
* *
* Licensed under the Apache License, Version 2.0 (the "License"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
@@ -16,18 +16,7 @@
package org.springframework.integration.samples.jms; package org.springframework.integration.samples.jms;
import java.io.ByteArrayOutputStream;
import java.io.PrintStream;
import junit.framework.Assert;
import org.junit.After;
import org.junit.Before;
import org.junit.Test;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext; import org.springframework.context.support.ClassPathXmlApplicationContext;
import org.springframework.integration.MessageChannel;
import org.springframework.integration.support.MessageBuilder;
/** /**
* A simple bootstrap main() method for starting a pair of JMS Channel * A simple bootstrap main() method for starting a pair of JMS Channel
@@ -39,6 +28,7 @@ import org.springframework.integration.support.MessageBuilder;
* See the configuration in the three XML files that are referenced below. * See the configuration in the three XML files that are referenced below.
* *
* @author Mark Fisher * @author Mark Fisher
* @author Gunnar Hillert
*/ */
public class ChannelAdapterDemo { public class ChannelAdapterDemo {

View File

@@ -5,12 +5,17 @@
<groupId>org.springframework.integration.samples</groupId> <groupId>org.springframework.integration.samples</groupId>
<artifactId>jmx</artifactId> <artifactId>jmx</artifactId>
<name>Samples (Basic) - JMX</name> <name>Samples (Basic) - JMX</name>
<version>2.1.0.BUILD-SNAPSHOT</version> <version>2.2.0.BUILD-SNAPSHOT</version>
<packaging>jar</packaging> <packaging>jar</packaging>
<prerequisites>
<maven>2.2.1</maven>
</prerequisites>
<properties> <properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<spring.integration.version>2.1.0.RELEASE</spring.integration.version> <spring.integration.version>2.2.0.RC3</spring.integration.version>
<log4j.version>1.2.16</log4j.version> <log4j.version>1.2.17</log4j.version>
<junit.version>4.10</junit.version> <junit.version>4.10</junit.version>
</properties> </properties>
<dependencies> <dependencies>
@@ -41,13 +46,13 @@
<plugin> <plugin>
<groupId>org.apache.maven.plugins</groupId> <groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId> <artifactId>maven-compiler-plugin</artifactId>
<version>2.3.2</version> <version>2.5.1</version>
<configuration> <configuration>
<source>1.5</source> <source>1.6</source>
<target>1.5</target> <target>1.6</target>
<compilerArgument>-Xlint:all</compilerArgument> <compilerArgument>-Xlint:all</compilerArgument>
<showWarnings>true</showWarnings> <showWarnings>true</showWarnings>
<showDeprecation>false</showDeprecation> <showDeprecation>true</showDeprecation>
</configuration> </configuration>
</plugin> </plugin>
</plugins> </plugins>

View File

@@ -11,18 +11,18 @@
<url>http://www.springsource.org/spring-integration</url> <url>http://www.springsource.org/spring-integration</url>
<prerequisites> <prerequisites>
<maven>2.2.0</maven> <maven>2.2.1</maven>
</prerequisites> </prerequisites>
<properties> <properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<spring.integration.version>2.2.0.M2</spring.integration.version> <spring.integration.version>2.2.0.RC3</spring.integration.version>
<log4j.version>1.2.16</log4j.version> <log4j.version>1.2.17</log4j.version>
<junit.version>4.10</junit.version> <junit.version>4.10</junit.version>
<openjpa.version>2.2.0</openjpa.version> <openjpa.version>2.2.0</openjpa.version>
<eclipselink.version>2.3.2</eclipselink.version> <eclipselink.version>2.3.2</eclipselink.version>
<hibernate.version>4.0.1.Final</hibernate.version> <hibernate.version>4.0.1.Final</hibernate.version>
<spring-instrument.version>3.1.1.RELEASE</spring-instrument.version> <spring-instrument.version>3.1.3.RELEASE</spring-instrument.version>
</properties> </properties>
<repositories> <repositories>
@@ -49,7 +49,7 @@
<plugin> <plugin>
<groupId>org.apache.maven.plugins</groupId> <groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId> <artifactId>maven-compiler-plugin</artifactId>
<version>2.3.2</version> <version>2.5.1</version>
<configuration> <configuration>
<source>1.6</source> <source>1.6</source>
<target>1.6</target> <target>1.6</target>
@@ -117,7 +117,7 @@
<dependency> <dependency>
<groupId>org.slf4j</groupId> <groupId>org.slf4j</groupId>
<artifactId>slf4j-log4j12</artifactId> <artifactId>slf4j-log4j12</artifactId>
<version>1.6.4</version> <version>1.7.2</version>
</dependency> </dependency>
<!-- Embedded Database --> <!-- Embedded Database -->
@@ -125,7 +125,7 @@
<dependency> <dependency>
<groupId>com.h2database</groupId> <groupId>com.h2database</groupId>
<artifactId>h2</artifactId> <artifactId>h2</artifactId>
<version>1.3.162</version> <version>1.3.168</version>
</dependency> </dependency>
<!-- Persistence Provider --> <!-- Persistence Provider -->

View File

@@ -4,11 +4,16 @@
<groupId>org.springframework.integration.samples</groupId> <groupId>org.springframework.integration.samples</groupId>
<artifactId>mail</artifactId> <artifactId>mail</artifactId>
<name>Samples (Basic) - Mail Demo (IMAP + POP3)</name> <name>Samples (Basic) - Mail Demo (IMAP + POP3)</name>
<version>2.1.0.BUILD-SNAPSHOT</version> <version>2.2.0.BUILD-SNAPSHOT</version>
<prerequisites>
<maven>2.2.1</maven>
</prerequisites>
<properties> <properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<spring.integration.version>2.1.0.RELEASE</spring.integration.version> <spring.integration.version>2.2.0.RC3</spring.integration.version>
<log4j.version>1.2.16</log4j.version> <log4j.version>1.2.17</log4j.version>
<junit.version>4.10</junit.version> <junit.version>4.10</junit.version>
</properties> </properties>
<dependencies> <dependencies>
@@ -26,7 +31,7 @@
<dependency> <dependency>
<groupId>javax.mail</groupId> <groupId>javax.mail</groupId>
<artifactId>mail</artifactId> <artifactId>mail</artifactId>
<version>1.4.4</version> <version>1.4.5</version>
</dependency> </dependency>
<dependency> <dependency>
<groupId>log4j</groupId> <groupId>log4j</groupId>
@@ -45,13 +50,13 @@
<plugin> <plugin>
<groupId>org.apache.maven.plugins</groupId> <groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId> <artifactId>maven-compiler-plugin</artifactId>
<version>2.3.2</version> <version>2.5.1</version>
<configuration> <configuration>
<source>1.5</source> <source>1.6</source>
<target>1.5</target> <target>1.6</target>
<compilerArgument>-Xlint:all</compilerArgument> <compilerArgument>-Xlint:all</compilerArgument>
<showWarnings>true</showWarnings> <showWarnings>true</showWarnings>
<showDeprecation>false</showDeprecation> <showDeprecation>true</showDeprecation>
</configuration> </configuration>
</plugin> </plugin>
</plugins> </plugins>

View File

@@ -1,82 +1,68 @@
<h3>MongoDb Outbound Channel Adapter</h3> Spring Integration - MongoDb Sample
MongoDb Outbound Channel Adapter allows you to write the Message payload to a MongoDb document store. ================================
You can see the simplest configuration of the MongoDb Channel Adapter below: ### MongoDb Outbound Channel Adapter
```` The *MongoDb Outbound Channel Adapter* allows you to write the Message payload to a MongoDb document store. You can see the simplest configuration of the MongoDb Channel Adapter below:
<int-mongodb:outbound-channel-adapter id="deafultAdapter"/>
````
It will be initialized with the default instance of the <strong>MongoDbFactory</strong> (the default bean name is 'mongoDbFactory') otherwise you can provide its <int-mongodb:outbound-channel-adapter id="deafultAdapter"/>
reference via <strong>mongodb-factory</strong> attribute.
Now you can run the <strong>MongoDbOutboundAdapterDemo</strong>. After running it open terminal window and start MongoDb CLI It will be initialized with the default instance of the **MongoDbFactory** (the default bean name is 'mongoDbFactory') otherwise you can provide its
reference via **mongodb-factory** attribute.
```` Now you can run the **MongoDbOutboundAdapterDemo**. After running it open terminal window and start MongoDb CLI
$> mongo
```` $ mongo
Once in MongoDb CLI type a query: Once in MongoDb CLI type a query:
```` > db.data.find({})
> db.data.find({})
````
And you should see the 3 document entries we just created: And you should see the 3 document entries we just created:
````
{ "_id" : ObjectId("505ff83d03649ed6881d066b"), "_class" : "org.springframework.integration.samples.mongodb.domain.Person", "fname" : "John", "lname" : "Doe", "address" : { "street" : "3401 Hillview Ave", "city" : "Palo Alto", "zip" : "94304", "state" : "CA" } }
{ "_id" : ObjectId("505ff83d03649ed6881d066c"), "_class" : "org.springframework.integration.samples.mongodb.domain.Person", "fname" : "Josh", "lname" : "Doe", "address" : { "street" : "123 Main st", "city" : "San Francisco", "zip" : "94115", "state" : "CA" } }
{ "_id" : ObjectId("505ff83d03649ed6881d066d"), "_class" : "org.springframework.integration.samples.mongodb.domain.Person", "fname" : "Jane", "lname" : "Doe", "address" : { "street" : "2323 Market st", "city" : "Philadelphia", "zip" : "19152", "state" : "PA" } }
````
Note that our entries were represented by a very simple Java Beans style objects which were converted into JSON string using default converters.
Let's try to complicate the issue slightly. We are going to try to store a simple coma delimited String in our <strong>MongoDbOutboundAdapterDemo().runSimpleComplexAdapter()</strong> demo: { "_id" : ObjectId("505ff83d03649ed6881d066b"), "_class" : "org.springframework.integration.samples.mongodb.domain.Person", "fname" : "John", "lname" : "Doe", "address" : { "street" : "3401 Hillview Ave", "city" : "Palo Alto", "zip" : "94304", "state" : "CA" } }
{ "_id" : ObjectId("505ff83d03649ed6881d066c"), "_class" : "org.springframework.integration.samples.mongodb.domain.Person", "fname" : "Josh", "lname" : "Doe", "address" : { "street" : "123 Main st", "city" : "San Francisco", "zip" : "94115", "state" : "CA" } }
{ "_id" : ObjectId("505ff83d03649ed6881d066d"), "_class" : "org.springframework.integration.samples.mongodb.domain.Person", "fname" : "Jane", "lname" : "Doe", "address" : { "street" : "2323 Market st", "city" : "Philadelphia", "zip" : "19152", "state" : "PA" } }
```` Note that our entries were represented by a very simple Java Beans style objects which were converted into JSON string using default converters. Let's try to complicate the issue slightly. We are going to try to store a simple coma delimited String in our **MongoDbOutboundAdapterDemo().runSimpleComplexAdapter()** demo:
messageChannel.send(new GenericMessage<String>("John Dow, Palo Alto, 3401 Hillview Ave, 94304, CA"));
```` messageChannel.send(new GenericMessage<String>("John Dow, Palo Alto, 3401 Hillview Ave, 94304, CA"));
As you can see we are sending a Message with the String payload which represents a person. Executing this code will result in: As you can see we are sending a Message with the String payload which represents a person. Executing this code will result in:
````
Caused by: java.lang.IllegalArgumentException: can't serialize class java.lang.Character
````
That is because MongoDb attempts to convert the underlying string using default set of converters that are based on Java Beans convention.
In any case that is not what we are looking for in this case anyway since we want to store this object as a document with each field represented individually so we need to parse this string into a set of fields first. To do so we will apply a custom <strong>MongoConverter</strong>. Modify the sample configuration of <strong>simpleAdapterWithConverter</strong> to add a reference to an already configured converter.
```` Caused by: java.lang.IllegalArgumentException: can't serialize class java.lang.Character
<int-mongodb:outbound-channel-adapter id="adapterWithConverter"
That is because MongoDb attempts to convert the underlying string using default set of converters that are based on Java Beans convention.
In any case that is not what we are looking for in this case anyway since we want to store this object as a document with each field represented individually so we need to parse this string into a set of fields first. To do so we will apply a custom **MongoConverter**. Modify the sample configuration of **simpleAdapterWithConverter** to add a reference to an already configured converter.
<int-mongodb:outbound-channel-adapter id="adapterWithConverter"
mongo-converter="stringConverter"/> mongo-converter="stringConverter"/>
````
Run the demo again and you'll see that it will succeed this time and you should see the stored object as: Run the demo again and you'll see that it will succeed this time and you should see the stored object as:
````
{ "_id" : ObjectId("505ffeac0364f8a92337657e"), "fname" : "John", "lname" : "Dow", "address" : { "city" : "Palo Alto", "street" : "3401 Hillview Ave", "zip" : "94304", "state" : "CA" } } { "_id" : ObjectId("505ffeac0364f8a92337657e"), "fname" : "John", "lname" : "Dow", "address" : { "city" : "Palo Alto", "street" : "3401 Hillview Ave", "zip" : "94304", "state" : "CA" } }
````
This time the conversion is done using a provided converter and you can see in the StringConverter.write(..) method that all that we are doing is parsing the input String and adding its data as an individual fields to an instance of the DBObject. This time the conversion is done using a provided converter and you can see in the StringConverter.write(..) method that all that we are doing is parsing the input String and adding its data as an individual fields to an instance of the DBObject.
For even more complex scenarios you can also bootstrap the adapter with the custom instance of the <strong>MongoTemplate</strong>, but its out of scope of this blog. For even more complex scenarios you can also bootstrap the adapter with the custom instance of the **MongoTemplate**, but its out of scope of this blog.
<h3>MongoDb Inbound Channel Adapter</h3> ### MongoDb Inbound Channel Adapter<
MongoDb Inbound Channel Adapter allows you to read documents from the MongoDb and send them as Message payloads downstream.
This simple example shows you how to read the documents stored in the MongoDb. For this example we'll use data stored by the MongoDb Outbound Channel Adapter discussed in the previous section. MongoDb Inbound Channel Adapter allows you to read documents from the MongoDb and send them as Message payloads downstream. This simple example shows you how to read the documents stored in the MongoDb. For this example we'll use data stored by the MongoDb Outbound Channel Adapter discussed in the previous section.
As you can see from the example below, the configuration of MongoDb Inbound Channel Adapter is very similar to any other polling Inbound Channel Adapter. As you can see from the example below, the configuration of MongoDb Inbound Channel Adapter is very similar to any other polling Inbound Channel Adapter.
```` <int-mongodb:inbound-channel-adapter id="simpleInboundAdapter" channel="splittingChannel"
<int-mongodb:inbound-channel-adapter id="simpleInboundAdapter" channel="splittingChannel"
query="{address.state : 'CA'}"> query="{address.state : 'CA'}">
<int:poller fixed-rate="60000" max-messages-per-poll="1"/> <int:poller fixed-rate="60000" max-messages-per-poll="1"/>
</int-mongodb:inbound-channel-adapter> </int-mongodb:inbound-channel-adapter>
````
Notice the <strong>query</strong> attribute which allows you to provide JSON queries represented as simple String. For more information on MongoDb queries please refer to <a href="http://www.mongodb.org/display/DOCS/Querying">MongoDb documentation</a> Notice the **query** attribute which allows you to provide JSON queries represented as simple String. For more information on MongoDb queries please refer to [MongoDb documentation](http://www.mongodb.org/display/DOCS/Querying)
In the above case we are selecting all documents where <i>state</i> element of the <i>address</i> element is <b>'CA'</b>. As you may have guessed the MongoDb Inbound Channel Adapter returns List by default, so you can easily configure a very basic splitter downstream (as in this example) to process one message at the time. Run the <strong>MongoDbInboundAdapterDemo</strong> and you should see the results in the console: In the above case we are selecting all documents where *state* element of the *address* element is **'CA'**. As you may have guessed the MongoDb Inbound Channel Adapter returns List by default, so you can easily configure a very basic splitter downstream (as in this example) to process one message at the time. Run the **MongoDbInboundAdapterDemo** and you should see the results in the console:
```` 04:37:30.720 WARN . . . { "_id" : { "$oid" : "50601bca0364063859066bcd"} , "_class" : "org.springframework.integration.samples.mongodb.domain.Person" , "fname" : "John" , "lname" : "Doe" , "address" : { "street" : "3401 Hillview Ave" , "city" : "Palo Alto" , "zip" : "94304" , "state" : "CA"}}
04:37:30.720 WARN . . . { "_id" : { "$oid" : "50601bca0364063859066bcd"} , "_class" : "org.springframework.integration.samples.mongodb.domain.Person" , "fname" : "John" , "lname" : "Doe" , "address" : { "street" : "3401 Hillview Ave" , "city" : "Palo Alto" , "zip" : "94304" , "state" : "CA"}} 04:37:30.722 WARN . . . { "_id" : { "$oid" : "50601bca0364063859066bce"} , "_class" : "org.springframework.integration.samples.mongodb.domain.Person" , "fname" : "Josh" , "lname" : "Doe" , "address" : { "street" : "123 Main st" , "city" : "San Francisco" , "zip" : "94115" , "state" : "CA"}}
04:37:30.722 WARN . . . { "_id" : { "$oid" : "50601bca0364063859066bce"} , "_class" : "org.springframework.integration.samples.mongodb.domain.Person" , "fname" : "Josh" , "lname" : "Doe" , "address" : { "street" : "123 Main st" , "city" : "San Francisco" , "zip" : "94115" , "state" : "CA"}}
````
However, if you know that your query can only return a single result you can avoid returning List by configuring <strong>expect-single-result</strong> attribute setting its value to 'true'.
Also, you may wish to do some post-processing to the successfully processed data that was read from the MongoDb. However, if you know that your query can only return a single result you can avoid returning List by configuring **expect-single-result** attribute setting its value to *true*.
For example; you may want to move or remove a document after its been processed.
You can do this using Transaction Synchronization feature that was added with Spring Integration 2.2 and which will be discussed in the next blog in this series expected in a few days (from Gary Russell). However the impatient once can get more details now by reading MongoDb Inbound Channel Adapter section of the reference manual <a href="http://static.springsource.org/spring-integration/docs/2.2.0.RC1/reference/htmlsingle/#mongodb-inbound-channel-adapter">http://static.springsource.org/spring-integration/docs/2.2.0.RC1/reference/htmlsingle/#mongodb-inbound-channel-adapter</a> Also, you may wish to do some post-processing to the successfully processed data that was read from the MongoDb. For example; you may want to move or remove a document after its been processed.
You can do this using Transaction Synchronization feature that was added with *Spring Integration 2.2* and which will be discussed in the next blog in this series expected in a few days (from Gary Russell). However the impatient once can get more details now by reading MongoDb Inbound Channel Adapter section of the reference manual [http://static.springsource.org/spring-integration/docs/2.2.0.RC3/reference/htmlsingle/#mongodb-inbound-channel-adapter](http://static.springsource.org/spring-integration/docs/2.2.0.RC3/reference/htmlsingle/#mongodb-inbound-channel-adapter).

View File

@@ -4,16 +4,20 @@
<groupId>org.springframework.integration.samples</groupId> <groupId>org.springframework.integration.samples</groupId>
<artifactId>mongodb</artifactId> <artifactId>mongodb</artifactId>
<version>2.1.0.BUILD-SNAPSHOT</version> <version>2.2.0.BUILD-SNAPSHOT</version>
<packaging>jar</packaging> <packaging>jar</packaging>
<name>Samples (Basic) - MongoDb</name> <name>Samples (Basic) - MongoDb</name>
<url>http://www.springsource.org/spring-integration</url> <url>http://www.springsource.org/spring-integration</url>
<prerequisites>
<maven>2.2.1</maven>
</prerequisites>
<properties> <properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<spring.integration.version>2.2.0.RC1</spring.integration.version> <spring.integration.version>2.2.0.RC3</spring.integration.version>
<log4j.version>1.2.16</log4j.version> <log4j.version>1.2.17</log4j.version>
<junit.version>4.10</junit.version> <junit.version>4.10</junit.version>
</properties> </properties>
@@ -29,7 +33,7 @@
<plugins> <plugins>
<plugin> <plugin>
<artifactId>maven-eclipse-plugin</artifactId> <artifactId>maven-eclipse-plugin</artifactId>
<version>2.8</version> <version>2.9</version>
<configuration> <configuration>
<additionalProjectnatures> <additionalProjectnatures>
<projectnature>org.springframework.ide.eclipse.core.springnature</projectnature> <projectnature>org.springframework.ide.eclipse.core.springnature</projectnature>
@@ -44,7 +48,7 @@
<plugin> <plugin>
<groupId>org.apache.maven.plugins</groupId> <groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId> <artifactId>maven-compiler-plugin</artifactId>
<version>2.3.2</version> <version>2.5.1</version>
<configuration> <configuration>
<source>1.6</source> <source>1.6</source>
<target>1.6</target> <target>1.6</target>
@@ -56,49 +60,12 @@
<plugin> <plugin>
<groupId>org.codehaus.mojo</groupId> <groupId>org.codehaus.mojo</groupId>
<artifactId>exec-maven-plugin</artifactId> <artifactId>exec-maven-plugin</artifactId>
<version>1.2</version> <version>1.2.1</version>
<configuration> <configuration>
<mainClass>org.springframework.integration.samples.jdbc.Main</mainClass> <mainClass>org.springframework.integration.samples.jdbc.Main</mainClass>
</configuration> </configuration>
</plugin> </plugin>
</plugins> </plugins>
<pluginManagement>
<plugins>
<!--This plugin's configuration is used to store Eclipse m2e settings
only. It has no influence on the Maven build itself. -->
<plugin>
<groupId>org.eclipse.m2e</groupId>
<artifactId>lifecycle-mapping</artifactId>
<version>1.0.0</version>
<configuration>
<lifecycleMappingMetadata>
<pluginExecutions>
<pluginExecution>
<pluginExecutionFilter>
<groupId>
org.apache.maven.plugins
</groupId>
<artifactId>
maven-compiler-plugin
</artifactId>
<versionRange>
[2.3.2,)
</versionRange>
<goals>
<goal>testCompile</goal>
<goal>compile</goal>
</goals>
</pluginExecutionFilter>
<action>
<ignore></ignore>
</action>
</pluginExecution>
</pluginExecutions>
</lifecycleMappingMetadata>
</configuration>
</plugin>
</plugins>
</pluginManagement>
</build> </build>
<dependencies> <dependencies>

View File

@@ -11,13 +11,13 @@
<mongo:db-factory id="mongoDbFactory" dbname="test"/> <mongo:db-factory id="mongoDbFactory" dbname="test"/>
<int-mongodb:outbound-channel-adapter id="deafultAdapter" /> <int-mongodb:outbound-channel-adapter id="deafultAdapter" />
<int-mongodb:outbound-channel-adapter id="adapterWithConverter"/> <int-mongodb:outbound-channel-adapter id="adapterWithConverter" mongo-converter="stringConverter"/>
<!-- mongo-converter="stringConverter" --> <!-- mongo-converter="stringConverter" -->
<bean id="stringConverter" class="org.springframework.integration.samples.mongodb.util.StringConverter"> <bean id="stringConverter" class="org.springframework.integration.samples.mongodb.util.StringConverter">
<constructor-arg ref="mongoDbFactory"/> <constructor-arg ref="mongoDbFactory"/>
<constructor-arg> <constructor-arg>

View File

@@ -1,77 +1,82 @@
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"> xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion> <modelVersion>4.0.0</modelVersion>
<groupId>org.springframework.integration.samples</groupId> <groupId>org.springframework.integration.samples</groupId>
<artifactId>oddeven</artifactId> <artifactId>oddeven</artifactId>
<name>Samples (Basic) - Odd-Even Sample</name> <name>Samples (Basic) - Odd-Even Sample</name>
<version>2.1.0.BUILD-SNAPSHOT</version> <version>2.2.0.BUILD-SNAPSHOT</version>
<packaging>jar</packaging> <packaging>jar</packaging>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<spring.integration.version>2.1.0.RELEASE</spring.integration.version>
<log4j.version>1.2.16</log4j.version>
<junit.version>4.10</junit.version>
</properties>
<profiles> <prerequisites>
<profile> <maven>2.2.1</maven>
<id>cron</id> </prerequisites>
<properties>
<java.main.class>org.springframework.integration.samples.oddeven.CronOddEvenDemo</java.main.class>
</properties>
</profile>
<profile>
<id>interval</id>
<properties>
<java.main.class>org.springframework.integration.samples.oddeven.IntervalOddEvenDemoTestApp</java.main.class>
</properties>
</profile>
</profiles>
<dependencies> <properties>
<dependency> <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<groupId>org.springframework.integration</groupId> <spring.integration.version>2.2.0.RC3</spring.integration.version>
<artifactId>spring-integration-core</artifactId> <log4j.version>1.2.17</log4j.version>
<version>${spring.integration.version}</version> <junit.version>4.10</junit.version>
</dependency> </properties>
<dependency>
<groupId>log4j</groupId>
<artifactId>log4j</artifactId>
<version>${log4j.version}</version>
</dependency>
<!-- test-scoped dependencies -->
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>${junit.version}</version>
</dependency>
</dependencies>
<build> <profiles>
<plugins> <profile>
<plugin> <id>cron</id>
<groupId>org.apache.maven.plugins</groupId> <properties>
<artifactId>maven-compiler-plugin</artifactId> <java.main.class>org.springframework.integration.samples.oddeven.CronOddEvenDemo</java.main.class>
<version>2.3.2</version> </properties>
<configuration> </profile>
<source>1.5</source> <profile>
<target>1.5</target> <id>interval</id>
<compilerArgument>-Xlint:all</compilerArgument> <properties>
<showWarnings>true</showWarnings> <java.main.class>org.springframework.integration.samples.oddeven.IntervalOddEvenDemoTestApp</java.main.class>
<showDeprecation>false</showDeprecation> </properties>
</configuration> </profile>
</plugin> </profiles>
<plugin>
<groupId>org.codehaus.mojo</groupId> <dependencies>
<artifactId>exec-maven-plugin</artifactId> <dependency>
<version>1.2</version> <groupId>org.springframework.integration</groupId>
<configuration> <artifactId>spring-integration-core</artifactId>
<mainClass>${java.main.class}</mainClass> <version>${spring.integration.version}</version>
</configuration> </dependency>
</plugin> <dependency>
</plugins> <groupId>log4j</groupId>
</build> <artifactId>log4j</artifactId>
<version>${log4j.version}</version>
</dependency>
<!-- test-scoped dependencies -->
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>${junit.version}</version>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>2.5.1</version>
<configuration>
<source>1.6</source>
<target>1.6</target>
<compilerArgument>-Xlint:all</compilerArgument>
<showWarnings>true</showWarnings>
<showDeprecation>true</showDeprecation>
</configuration>
</plugin>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>exec-maven-plugin</artifactId>
<version>1.2.1</version>
<configuration>
<mainClass>${java.main.class}</mainClass>
</configuration>
</plugin>
</plugins>
</build>
<repositories> <repositories>
<repository> <repository>
<id>repo.springsource.org.milestone</id> <id>repo.springsource.org.milestone</id>

View File

@@ -5,7 +5,7 @@
xsi:schemaLocation="http://www.springframework.org/schema/beans xsi:schemaLocation="http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans.xsd http://www.springframework.org/schema/beans/spring-beans.xsd
http://www.springframework.org/schema/integration http://www.springframework.org/schema/integration
http://www.springframework.org/schema/integration/spring-integration-2.1.xsd"> http://www.springframework.org/schema/integration/spring-integration.xsd">
<annotation-config/> <annotation-config/>

View File

@@ -5,7 +5,7 @@
<modelVersion>4.0.0</modelVersion> <modelVersion>4.0.0</modelVersion>
<groupId>org.springframework.integration.samples</groupId> <groupId>org.springframework.integration.samples</groupId>
<artifactId>basic-samples</artifactId> <artifactId>basic-samples</artifactId>
<version>2.1.0.BUILD-SNAPSHOT</version> <version>2.2.0.BUILD-SNAPSHOT</version>
<name>Spring Integration Samples - Basic</name> <name>Spring Integration Samples - Basic</name>
<packaging>pom</packaging> <packaging>pom</packaging>

View File

@@ -4,14 +4,14 @@ Quote Sample
This example demonstrates the following aspects of the CORE EIP support available with Spring Integration: This example demonstrates the following aspects of the CORE EIP support available with Spring Integration:
1. Channel Adapter (Inbound and Stdout) 1. Channel Adapter (Inbound and Stdout)
2. Poller with Interval Trigers 2. Poller with Interval Triggers
3. Service Activator 3. Service Activator
It is a very simple example that introduces you to the Channel adapters and Pollers. It is a very simple example that introduces you to Channel adapters and Pollers.
Messages are simply being emitted by the Poller (interval based) triggering **nextTicker()** method of *TickerStream* class and sent to a **tickers** channel from which they are retrieved by the *TickerStream* service. 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.
*TickerStream* service generates random ticker symbols sending them to the **quotes** channel from which they are retrieved by the *QuoteService* (annotation based Service Activator). *QuoteService* generates random quotes sending them to the *Stdout Channel Adapter* where they are printed to a console. 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.
To execute sample simply run **QuoteDemoTest**. You should see the output similar to this: To execute sample simply run **QuoteDemoTest**. You should see the output similar to this:

View File

@@ -5,12 +5,15 @@
<groupId>org.springframework.integration.samples</groupId> <groupId>org.springframework.integration.samples</groupId>
<artifactId>quote</artifactId> <artifactId>quote</artifactId>
<name>Samples (Basic) - Quote Sample</name> <name>Samples (Basic) - Quote Sample</name>
<version>2.1.0.BUILD-SNAPSHOT</version> <version>2.2.0.BUILD-SNAPSHOT</version>
<packaging>jar</packaging> <packaging>jar</packaging>
<prerequisites>
<maven>2.2.1</maven>
</prerequisites>
<properties> <properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<spring.integration.version>2.1.0.RELEASE</spring.integration.version> <spring.integration.version>2.2.0.RC3</spring.integration.version>
<log4j.version>1.2.16</log4j.version> <log4j.version>1.2.17</log4j.version>
<junit.version>4.10</junit.version> <junit.version>4.10</junit.version>
</properties> </properties>
<dependencies> <dependencies>
@@ -36,13 +39,13 @@
<plugin> <plugin>
<groupId>org.apache.maven.plugins</groupId> <groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId> <artifactId>maven-compiler-plugin</artifactId>
<version>2.3.2</version> <version>2.5.1</version>
<configuration> <configuration>
<source>1.5</source> <source>1.6</source>
<target>1.5</target> <target>1.6</target>
<compilerArgument>-Xlint:all</compilerArgument> <compilerArgument>-Xlint:all</compilerArgument>
<showWarnings>true</showWarnings> <showWarnings>true</showWarnings>
<showDeprecation>false</showDeprecation> <showDeprecation>true</showDeprecation>
</configuration> </configuration>
</plugin> </plugin>
</plugins> </plugins>

View File

@@ -68,4 +68,4 @@ This sample uses a property **private.keyfile** to point to the location of your
>$ chmod 600 ~/.ssh/authorized_keys >$ chmod 600 ~/.ssh/authorized_keys
* Then edit **authorized_keys** file and paste in the contents of the public key file **sftp_rsa.pub**. * Then edit **authorized_keys** file and paste in the contents of the public key file **sftp_rsa.pub**.
* Move your private key file **sftp_rsa** to META-INF/keys directory * Move your private key file **sftp_rsa** to the directory **/src/test/resources/META-INF/keys/** directory.

View File

@@ -3,13 +3,16 @@
<modelVersion>4.0.0</modelVersion> <modelVersion>4.0.0</modelVersion>
<groupId>org.springframework.integration.samples</groupId> <groupId>org.springframework.integration.samples</groupId>
<artifactId>sftp</artifactId> <artifactId>sftp</artifactId>
<version>2.1.0.BUILD-SNAPSHOT</version> <version>2.2.0.BUILD-SNAPSHOT</version>
<name>Samples (Basic) - SFTP Demo</name> <name>Samples (Basic) - SFTP Demo</name>
<packaging>jar</packaging> <packaging>jar</packaging>
<prerequisites>
<maven>2.2.1</maven>
</prerequisites>
<properties> <properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<spring.integration.version>2.1.0.RELEASE</spring.integration.version> <spring.integration.version>2.2.0.RC3</spring.integration.version>
<log4j.version>1.2.16</log4j.version> <log4j.version>1.2.17</log4j.version>
<junit.version>4.10</junit.version> <junit.version>4.10</junit.version>
</properties> </properties>
<dependencies> <dependencies>
@@ -35,13 +38,13 @@
<plugin> <plugin>
<groupId>org.apache.maven.plugins</groupId> <groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId> <artifactId>maven-compiler-plugin</artifactId>
<version>2.3.2</version> <version>2.5.1</version>
<configuration> <configuration>
<source>1.5</source> <source>1.6</source>
<target>1.5</target> <target>1.6</target>
<compilerArgument>-Xlint:all</compilerArgument> <compilerArgument>-Xlint:all</compilerArgument>
<showWarnings>true</showWarnings> <showWarnings>true</showWarnings>
<showDeprecation>false</showDeprecation> <showDeprecation>true</showDeprecation>
</configuration> </configuration>
</plugin> </plugin>
</plugins> </plugins>

View File

@@ -20,10 +20,10 @@
<property name="port" value="22"/> <property name="port" value="22"/>
<property name="user" value="${user}"/> <property name="user" value="${user}"/>
</bean> </bean>
<int-sftp:inbound-channel-adapter id="sftpInbondAdapter" <int-sftp:inbound-channel-adapter id="sftpInbondAdapter"
channel="receiveChannel" channel="receiveChannel"
session-factory="sftpSessionFactory" session-factory="sftpSessionFactory"
local-directory="file:local-dir" local-directory="file:local-dir"
remote-directory="<<SPECIFY REMOTE DIRECTORY (e.g., /{workspace}/samples/basic/sftp/remote-target-dir)>>" remote-directory="<<SPECIFY REMOTE DIRECTORY (e.g., /{workspace}/samples/basic/sftp/remote-target-dir)>>"
auto-create-local-directory="true" auto-create-local-directory="true"
@@ -31,9 +31,9 @@
filename-regex=".*\.txt$"> filename-regex=".*\.txt$">
<int:poller fixed-rate="1000" max-messages-per-poll="1"/> <int:poller fixed-rate="1000" max-messages-per-poll="1"/>
</int-sftp:inbound-channel-adapter> </int-sftp:inbound-channel-adapter>
<int:channel id="receiveChannel"> <int:channel id="receiveChannel">
<int:queue/> <int:queue/>
</int:channel> </int:channel>
</beans> </beans>

View File

@@ -47,7 +47,7 @@
expression="headers['file_remoteDirectory'] + '/' + headers['file_remoteFile']" expression="headers['file_remoteDirectory'] + '/' + headers['file_remoteFile']"
request-channel="toRm" request-channel="toRm"
command="rm"/> command="rm"/>
<int:aggregator input-channel="aggregateResultsChannel"/> <int:aggregator input-channel="aggregateResultsChannel"/>
</beans> </beans>

View File

@@ -10,7 +10,7 @@
http://www.springframework.org/schema/integration/sftp http://www.springframework.org/schema/integration/sftp/spring-integration-sftp.xsd"> http://www.springframework.org/schema/integration/sftp http://www.springframework.org/schema/integration/sftp/spring-integration-sftp.xsd">
<context:property-placeholder location="classpath:user.properties"/> <context:property-placeholder location="classpath:user.properties"/>
<bean id="sftpSessionFactory" class="org.springframework.integration.sftp.session.DefaultSftpSessionFactory"> <bean id="sftpSessionFactory" class="org.springframework.integration.sftp.session.DefaultSftpSessionFactory">
<property name="host" value="localhost"/> <property name="host" value="localhost"/>
<property name="privateKey" value="classpath:META-INF/keys/sftp_rsa"/> <property name="privateKey" value="classpath:META-INF/keys/sftp_rsa"/>
@@ -18,13 +18,13 @@
<property name="port" value="22"/> <property name="port" value="22"/>
<property name="user" value="${user}"/> <property name="user" value="${user}"/>
</bean> </bean>
<int:channel id="inputChannel"/> <int:channel id="inputChannel"/>
<int-sftp:outbound-channel-adapter id="sftpOutboundAdapter" <int-sftp:outbound-channel-adapter id="sftpOutboundAdapter"
session-factory="sftpSessionFactory" session-factory="sftpSessionFactory"
channel="inputChannel" channel="inputChannel"
remote-filename-generator-expression="payload.getName() + '_foo'" remote-filename-generator-expression="payload.getName() + '_foo'"
remote-directory="<SPECIFY REMOTE DIRECTORY (e.g., /{workspace}/samples/basic/sftp/remote-target-dir)>"/> remote-directory="<SPECIFY REMOTE DIRECTORY (e.g., /{workspace}/samples/basic/sftp/remote-target-dir)>"/>
</beans> </beans>

View File

@@ -5,7 +5,7 @@ Spring Integration - TCP-AMQP Sample
This sample demonstrates basic functionality of bridging **Spring Integration TCP Adapters** with **Spring Integration AMQP Adapters**. This sample demonstrates basic functionality of bridging **Spring Integration TCP Adapters** with **Spring Integration AMQP Adapters**.
Once the application is started, you enter some text in a telnet session and the data is written to an AMQP queue, which is then consumed and the result echoed to a netcat session. Once the application is started, you enter some text in a telnet session and the data is written to an AMQP queue, which is then consumed and the result echoed to a [netcat][] session.
telnet->tcp-inbound-adapter->rabbit->tcp-outbound-adapter->netcat telnet->tcp-inbound-adapter->rabbit->tcp-outbound-adapter->netcat
@@ -16,6 +16,14 @@ netcat: http://en.wikipedia.org/wiki/Netcat
# How to Run the Sample # How to Run the Sample
## Start netcat
In a terminal window start [netcat][], listening on port *11112*:
netcat -l -p 11112
## Start the Application
If you imported the example into your IDE, you can just run class **org.springframework.integration.samples.tcpamqp.Main**. For example in [SpringSource Tool Suite](http://www.springsource.com/developer/sts) (STS) do: If you imported the example into your IDE, you can just run class **org.springframework.integration.samples.tcpamqp.Main**. For example in [SpringSource Tool Suite](http://www.springsource.com/developer/sts) (STS) do:
* Right-click on Main class --> Run As --> Java Application * Right-click on Main class --> Run As --> Java Application
@@ -24,15 +32,13 @@ Alternatively, you can start the sample from the command line ([Maven](http://ma
* mvn exec:java * mvn exec:java
In another terminal start netcat, listening on port 11112 ## Run Telnet
netcat -l 11112 In another terminal window, telnet to localhost:11111
In another terminat, telnet to localhost:11111
telnet localhost 11111 telnet localhost 11111
Data typed into the telnet terminal will be echoed to the netcat terminal, via the rabbit queue. Data typed into the telnet terminal will be echoed to the [netcat][] terminal, via the rabbit queue.
# Used Spring Integration components # Used Spring Integration components
@@ -52,3 +58,5 @@ Some further resources:
* RabbitMQ - [http://www.rabbitmq.com/](http://www.rabbitmq.com/) * RabbitMQ - [http://www.rabbitmq.com/](http://www.rabbitmq.com/)
* Spring AMQP - [http://www.springsource.org/spring-amqp](http://www.springsource.org/spring-amqp) * Spring AMQP - [http://www.springsource.org/spring-amqp](http://www.springsource.org/spring-amqp)
[netcat]: http://en.wikipedia.org/wiki/Netcat

View File

@@ -1,21 +1,26 @@
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion> <modelVersion>4.0.0</modelVersion>
<groupId>org.springframework.integration.samples</groupId> <groupId>org.springframework.integration.samples</groupId>
<artifactId>tcp-amqp</artifactId> <artifactId>tcp-amqp</artifactId>
<version>2.1.0.BUILD-SNAPSHOT</version> <version>2.2.0.BUILD-SNAPSHOT</version>
<packaging>jar</packaging> <packaging>jar</packaging>
<name>Samples (Basic) - TCP-AMQP</name> <name>Samples (Basic) - TCP-AMQP</name>
<url>http://www.springsource.org/spring-integration</url> <url>http://www.springsource.org/spring-integration</url>
<properties> <prerequisites>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> <maven>2.2.1</maven>
<spring.integration.version>2.1.0.RELEASE</spring.integration.version> </prerequisites>
<slf4j.version>1.6.4</slf4j.version>
<junit.version>4.10</junit.version> <properties>
</properties> <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<spring.amqp.version>1.1.3.RELEASE</spring.amqp.version>
<spring.integration.version>2.2.0.RC3</spring.integration.version>
<slf4j.version>1.6.4</slf4j.version>
<junit.version>4.10</junit.version>
</properties>
<repositories> <repositories>
<repository> <repository>
@@ -25,109 +30,109 @@
</repository> </repository>
</repositories> </repositories>
<build> <build>
<plugins> <plugins>
<plugin> <plugin>
<artifactId>maven-eclipse-plugin</artifactId> <artifactId>maven-eclipse-plugin</artifactId>
<version>2.8</version> <version>2.9</version>
<configuration> <configuration>
<additionalProjectnatures> <additionalProjectnatures>
<projectnature>org.springframework.ide.eclipse.core.springnature</projectnature> <projectnature>org.springframework.ide.eclipse.core.springnature</projectnature>
</additionalProjectnatures> </additionalProjectnatures>
<additionalBuildcommands> <additionalBuildcommands>
<buildcommand>org.springframework.ide.eclipse.core.springbuilder</buildcommand> <buildcommand>org.springframework.ide.eclipse.core.springbuilder</buildcommand>
</additionalBuildcommands> </additionalBuildcommands>
<downloadSources>true</downloadSources> <downloadSources>true</downloadSources>
<downloadJavadocs>true</downloadJavadocs> <downloadJavadocs>true</downloadJavadocs>
</configuration> </configuration>
</plugin> </plugin>
<plugin> <plugin>
<groupId>org.apache.maven.plugins</groupId> <groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId> <artifactId>maven-compiler-plugin</artifactId>
<version>2.3.2</version> <version>2.5.1</version>
<configuration> <configuration>
<source>1.6</source> <source>1.6</source>
<target>1.6</target> <target>1.6</target>
<compilerArgument>-Xlint:all</compilerArgument> <compilerArgument>-Xlint:all</compilerArgument>
<showWarnings>true</showWarnings> <showWarnings>true</showWarnings>
<showDeprecation>true</showDeprecation> <showDeprecation>true</showDeprecation>
</configuration> </configuration>
</plugin> </plugin>
<plugin> <plugin>
<groupId>org.codehaus.mojo</groupId> <groupId>org.codehaus.mojo</groupId>
<artifactId>exec-maven-plugin</artifactId> <artifactId>exec-maven-plugin</artifactId>
<version>1.2</version> <version>1.2.1</version>
<configuration> <configuration>
<mainClass>org.springframework.integration.samples.tcpamqp.Main</mainClass> <mainClass>org.springframework.integration.samples.tcpamqp.Main</mainClass>
</configuration> </configuration>
</plugin> </plugin>
</plugins> </plugins>
</build> </build>
<dependencies> <dependencies>
<!-- Testing --> <!-- Testing -->
<dependency> <dependency>
<groupId>junit</groupId> <groupId>junit</groupId>
<artifactId>junit</artifactId> <artifactId>junit</artifactId>
<version>${junit.version}</version> <version>${junit.version}</version>
<scope>test</scope> <scope>test</scope>
</dependency> </dependency>
<!-- Spring Integration --> <!-- Spring Integration -->
<dependency> <dependency>
<groupId>org.springframework.integration</groupId> <groupId>org.springframework.integration</groupId>
<artifactId>spring-integration-core</artifactId> <artifactId>spring-integration-core</artifactId>
<version>${spring.integration.version}</version> <version>${spring.integration.version}</version>
</dependency> </dependency>
<dependency> <dependency>
<groupId>org.springframework.integration</groupId> <groupId>org.springframework.integration</groupId>
<artifactId>spring-integration-amqp</artifactId> <artifactId>spring-integration-amqp</artifactId>
<version>${spring.integration.version}</version> <version>${spring.integration.version}</version>
</dependency> </dependency>
<dependency> <dependency>
<groupId>org.springframework.integration</groupId> <groupId>org.springframework.integration</groupId>
<artifactId>spring-integration-groovy</artifactId> <artifactId>spring-integration-groovy</artifactId>
<version>${spring.integration.version}</version> <version>${spring.integration.version}</version>
</dependency> </dependency>
<dependency> <dependency>
<groupId>org.springframework.integration</groupId> <groupId>org.springframework.integration</groupId>
<artifactId>spring-integration-ip</artifactId> <artifactId>spring-integration-ip</artifactId>
<version>${spring.integration.version}</version> <version>${spring.integration.version}</version>
</dependency> </dependency>
<dependency> <dependency>
<groupId>org.springframework.amqp</groupId> <groupId>org.springframework.amqp</groupId>
<artifactId>spring-rabbit</artifactId> <artifactId>spring-rabbit</artifactId>
<version>1.0.1.BUILD-SNAPSHOT</version> <version>${spring.amqp.version}</version>
</dependency> </dependency>
<!-- Logging --> <!-- Logging -->
<dependency> <dependency>
<groupId>org.slf4j</groupId> <groupId>org.slf4j</groupId>
<artifactId>slf4j-log4j12</artifactId> <artifactId>slf4j-log4j12</artifactId>
<version>${slf4j.version}</version> <version>${slf4j.version}</version>
</dependency> </dependency>
<dependency> <dependency>
<groupId>org.slf4j</groupId> <groupId>org.slf4j</groupId>
<artifactId>slf4j-api</artifactId> <artifactId>slf4j-api</artifactId>
<version>${slf4j.version}</version> <version>${slf4j.version}</version>
</dependency> </dependency>
<dependency> <dependency>
<groupId>org.slf4j</groupId> <groupId>org.slf4j</groupId>
<artifactId>log4j-over-slf4j</artifactId> <artifactId>log4j-over-slf4j</artifactId>
<version>${slf4j.version}</version> <version>${slf4j.version}</version>
</dependency> </dependency>
<dependency> <dependency>
<groupId>org.slf4j</groupId> <groupId>org.slf4j</groupId>
<artifactId>jcl-over-slf4j</artifactId> <artifactId>jcl-over-slf4j</artifactId>
<version>${slf4j.version}</version> <version>${slf4j.version}</version>
</dependency> </dependency>
</dependencies> </dependencies>
</project> </project>

View File

@@ -20,7 +20,7 @@
<int:channel id="toRabbit" /> <int:channel id="toRabbit" />
<int-amqp:outbound-channel-adapter channel="toRabbit" <int-amqp:outbound-channel-adapter channel="toRabbit"
amqp-template="amqpTemplate" exchange-name="si.test.exchange" amqp-template="amqpTemplate" exchange-name="si.test.exchange"
routing-key="si.test.binding"/> routing-key="si.test.binding"/>
<!-- From RabbitMQ To STDOUT --> <!-- From RabbitMQ To STDOUT -->
@@ -29,26 +29,26 @@
queue-names="si.test.queue" queue-names="si.test.queue"
connection-factory="connectionFactory" /> connection-factory="connectionFactory" />
<int:channel id="fromRabbit" /> <int:channel id="fromRabbit" />
<int-ip:tcp-connection-factory id="client" type="client" host="localhost" port="11112"/> <int-ip:tcp-connection-factory id="client" type="client" host="localhost" port="11112"/>
<int-ip:tcp-outbound-channel-adapter channel="fromRabbit" connection-factory="client"/> <int-ip:tcp-outbound-channel-adapter channel="fromRabbit" connection-factory="client"/>
<!-- Infrastructure -->
<rabbit:connection-factory id="connectionFactory" /> <!-- Infrastructure -->
<rabbit:template id="amqpTemplate" connection-factory="connectionFactory" /> <rabbit:connection-factory id="connectionFactory" />
<rabbit:admin connection-factory="connectionFactory" /> <rabbit:template id="amqpTemplate" connection-factory="connectionFactory" />
<rabbit:queue name="si.test.queue" /> <rabbit:admin connection-factory="connectionFactory" />
<rabbit:direct-exchange name="si.test.exchange"> <rabbit:queue name="si.test.queue" />
<rabbit:bindings>
<rabbit:binding queue="si.test.queue" key="si.test.binding" /> <rabbit:direct-exchange name="si.test.exchange">
</rabbit:bindings> <rabbit:bindings>
</rabbit:direct-exchange> <rabbit:binding queue="si.test.queue" key="si.test.binding" />
</rabbit:bindings>
</rabbit:direct-exchange>
</beans> </beans>

View File

@@ -1,17 +1,19 @@
TCP Sample TCP Sample
========== ==========
This is a place to get started with the Transmission Control Protocol (TCP). It demonstrates a simple message flow represented by the diagram below: This is a place to get started with the [Transmission Control Protocol][] (TCP). It demonstrates a simple message flow represented by the diagram below:
Gateway -> Channel -> TcpOutboundGateway -> <===Socket===> -> TcpInboundGateway -> Channel -> ServiceActivator Gateway -> Channel -> TcpOutboundGateway -> <===Socket===> -> TcpInboundGateway -> Channel -> ServiceActivator
The service returns a response which the inbound gateway sends back over the socket to the outbound gateway and the result is returned to the client that invoked the original SimpleGateway method. The service returns a response which the *Inbound Gateway* sends back over the socket to the *Outbound Gateway* and the result is returned to the client that invoked the original **SimpleGateway** method.
To run sample simply execute a test case in **org.springframework.integration.samples.tcpclientservice** package. ## Running the Sample
Note that the test case includes an alternative configuration that uses the in-built conversion service and the channel dataType attribute, instead of explicit transformers, to convert from byte arrays to Strings. To run sample simply execute a test case in the **org.springframework.integration.samples.tcpclientserver** package.
Simply change the @ContextConfiguration to switch between the two techniques. In addition, a simple telnet server is provided; see **TelnetServer** in src/main/java. Run this class as a Java application and then use telnet to connect to the service (**telnet localhost 11111**). Note that the test case includes an alternative configuration that uses the built-in *conversion service* and the channel *dataType* attribute, instead of explicit *Transformers*, to convert from byte arrays to Strings.
Simply change the *@ContextConfiguration* to switch between the two techniques. In addition, a simple telnet server is provided; see **TelnetServer** in *src/main/java*. Run this class as a Java application and then use `telnet` to connect to the service (**telnet localhost 11111**).
Messages sent will be returned, preceded by 'echo:'. Messages sent will be returned, preceded by 'echo:'.
@@ -28,7 +30,7 @@ Messages sent will be returned, preceded by 'echo:'.
telnet> quit telnet> quit
Connection closed. Connection closed.
Note that the test case also demonstrates error handling on an inbound gateway using direct channels. If the payload is 'FAIL', the EchoService throws an exception. The gateway is configured with an error-channel attribute. Messages sent to that channel are consumed by a transformer that concatenates the inbound message payload with the message text from the thrown exception, returning **FAIL:Failure Demonstration** over the TCP socket. >Note that the test case also demonstrates error handling on an inbound gateway using direct channels. If the payload is 'FAIL', the EchoService throws an exception. The gateway is configured >with an error-channel attribute. Messages sent to that channel are consumed by a transformer that concatenates the inbound message payload with the message text from the thrown exception, >returning **FAIL:Failure Demonstration** over the TCP socket.
This can also be demonstrated with the telnet client thus... This can also be demonstrated with the telnet client thus...
@@ -47,8 +49,10 @@ This can also be demonstrated with the telnet client thus...
telnet> quit telnet> quit
Connection closed. Connection closed.
A third option exists for converting a stream of bytes to a domain object or message payload. You can hook up different serializers/deserializers at the connection factory which will apply the conversions right when the stream comes in to the gateway and right when it goes out. A third option exists for converting a stream of bytes to a domain object or message payload. You can hook up different serializers/deserializers at the connection factory which will apply the conversions right when the stream comes in to the *Gateway* and right when it goes out.
See **TcpServerConnectionDeserializeTest** for using a simple (comes with spring) Stx/Etx serializer. See **TcpServerConnectionDeserializeTest** for using a simple (comes with spring) Stx/Etx serializer.
See **TcpServerCustomSerializerTest** for creating and using your own serializers See **TcpServerCustomSerializerTest** for creating and using your own serializers
[Transmission Control Protocol]: http://en.wikipedia.org/wiki/Transmission_Control_Protocol

View File

@@ -4,14 +4,17 @@
<modelVersion>4.0.0</modelVersion> <modelVersion>4.0.0</modelVersion>
<groupId>org.springframework.integration.samples</groupId> <groupId>org.springframework.integration.samples</groupId>
<artifactId>tcp-client-server</artifactId> <artifactId>tcp-client-server</artifactId>
<version>2.1.0.BUILD-SNAPSHOT</version> <version>2.2.0.BUILD-SNAPSHOT</version>
<name>Samples (Basic) - TCP Client Server Sample</name> <name>Samples (Basic) - TCP Client Server Sample</name>
<packaging>jar</packaging> <packaging>jar</packaging>
<prerequisites>
<maven>2.2.1</maven>
</prerequisites>
<properties> <properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<spring.version>3.1.0.RELEASE</spring.version> <spring.version>3.1.3.RELEASE</spring.version>
<spring.integration.version>2.1.0.RELEASE</spring.integration.version> <spring.integration.version>2.2.0.RC3</spring.integration.version>
<log4j.version>1.2.16</log4j.version> <log4j.version>1.2.17</log4j.version>
<junit.version>4.10</junit.version> <junit.version>4.10</junit.version>
</properties> </properties>
<dependencies> <dependencies>
@@ -47,25 +50,24 @@
<version>${spring.version}</version> <version>${spring.version}</version>
<scope>test</scope> <scope>test</scope>
</dependency> </dependency>
<dependency> <dependency>
<groupId>commons-lang</groupId> <groupId>commons-lang</groupId>
<artifactId>commons-lang</artifactId> <artifactId>commons-lang</artifactId>
<version>2.6</version> <version>2.6</version>
</dependency> </dependency>
</dependencies>
</dependencies>
<build> <build>
<plugins> <plugins>
<plugin> <plugin>
<groupId>org.apache.maven.plugins</groupId> <groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId> <artifactId>maven-compiler-plugin</artifactId>
<version>2.3.2</version> <version>2.5.1</version>
<configuration> <configuration>
<source>1.5</source> <source>1.6</source>
<target>1.5</target> <target>1.6</target>
<compilerArgument>-Xlint:all</compilerArgument> <compilerArgument>-Xlint:all</compilerArgument>
<showWarnings>true</showWarnings> <showWarnings>true</showWarnings>
<showDeprecation>false</showDeprecation> <showDeprecation>true</showDeprecation>
</configuration> </configuration>
</plugin> </plugin>
</plugins> </plugins>

View File

@@ -4,14 +4,17 @@
<modelVersion>4.0.0</modelVersion> <modelVersion>4.0.0</modelVersion>
<groupId>org.springframework.integration.samples</groupId> <groupId>org.springframework.integration.samples</groupId>
<artifactId>testing-examples</artifactId> <artifactId>testing-examples</artifactId>
<version>2.1.0.BUILD-SNAPSHOT</version> <version>2.2.0.BUILD-SNAPSHOT</version>
<name>Samples (Basic) - Testing Examples</name> <name>Samples (Basic) - Testing Examples</name>
<packaging>jar</packaging> <packaging>jar</packaging>
<prerequisites>
<maven>2.2.1</maven>
</prerequisites>
<properties> <properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<spring.integration.version>2.1.0.RELEASE</spring.integration.version> <spring.integration.version>2.2.0.RC3</spring.integration.version>
<spring.version>3.1.0.RELEASE</spring.version> <spring.version>3.1.3.RELEASE</spring.version>
<log4j.version>1.2.16</log4j.version> <log4j.version>1.2.17</log4j.version>
<junit.version>4.10</junit.version> <junit.version>4.10</junit.version>
</properties> </properties>
<dependencies> <dependencies>
@@ -67,62 +70,62 @@
<artifactId>spring-webmvc</artifactId> <artifactId>spring-webmvc</artifactId>
<version>${spring.version}</version> <version>${spring.version}</version>
</dependency> </dependency>
<dependency> <dependency>
<groupId>org.springframework</groupId> <groupId>org.springframework</groupId>
<artifactId>spring-context</artifactId> <artifactId>spring-context</artifactId>
<version>${spring.version}</version> <version>${spring.version}</version>
<exclusions> <exclusions>
<exclusion> <exclusion>
<artifactId>spring-expression</artifactId> <artifactId>spring-expression</artifactId>
<groupId>org.springframework</groupId> <groupId>org.springframework</groupId>
</exclusion> </exclusion>
</exclusions> </exclusions>
</dependency> </dependency>
<dependency> <dependency>
<groupId>org.springframework</groupId> <groupId>org.springframework</groupId>
<artifactId>spring-oxm</artifactId> <artifactId>spring-oxm</artifactId>
<version>${spring.version}</version> <version>${spring.version}</version>
</dependency> </dependency>
</dependencies> </dependencies>
<build> <build>
<testResources> <testResources>
<testResource> <testResource>
<directory>src/test/java</directory> <directory>src/test/java</directory>
<includes> <includes>
<include>**/*</include> <include>**/*</include>
</includes> </includes>
<excludes> <excludes>
<exclude>**/*.java</exclude> <exclude>**/*.java</exclude>
</excludes> </excludes>
</testResource> </testResource>
<testResource> <testResource>
<directory>src/test/resources</directory> <directory>src/test/resources</directory>
<includes> <includes>
<include>**/*</include> <include>**/*</include>
</includes> </includes>
</testResource> </testResource>
</testResources> </testResources>
<plugins> <plugins>
<plugin> <plugin>
<groupId>org.apache.maven.plugins</groupId> <groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId> <artifactId>maven-compiler-plugin</artifactId>
<version>2.3.2</version> <version>2.5.1</version>
<configuration> <configuration>
<source>1.5</source> <source>1.6</source>
<target>1.5</target> <target>1.6</target>
<compilerArgument>-Xlint:all</compilerArgument> <compilerArgument>-Xlint:all</compilerArgument>
<showWarnings>true</showWarnings> <showWarnings>true</showWarnings>
<showDeprecation>false</showDeprecation> <showDeprecation>true</showDeprecation>
</configuration> </configuration>
</plugin> </plugin>
<plugin> <plugin>
<artifactId>maven-surefire-plugin</artifactId> <artifactId>maven-surefire-plugin</artifactId>
<version>2.11</version> <version>2.12.4</version>
<configuration> <configuration>
<includes> <includes>
<include>**/*Tests.java</include> <include>**/*Tests.java</include>
</includes> </includes>
</configuration> </configuration>
</plugin> </plugin>
</plugins> </plugins>
</build> </build>
@@ -133,4 +136,4 @@
<url>https://repo.springsource.org/libs-milestone</url> <url>https://repo.springsource.org/libs-milestone</url>
</repository> </repository>
</repositories> </repositories>
</project> </project>

View File

@@ -1,5 +1,5 @@
/* /*
* Copyright 2002-2011 the original author or authors. * Copyright 2002-2012 the original author or authors.
* *
* Licensed under the Apache License, Version 2.0 (the "License"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
@@ -19,11 +19,12 @@ import java.util.List;
/** /**
* @author Gary Russell * @author Gary Russell
* @author Gunnar Hillert
* @since 2.0.2 * @since 2.0.2
* *
*/ */
public interface WeatherAndTraffic { public interface WeatherAndTraffic {
public List<String> getByZip(String zip); List<String> getByZip(String zip);
} }

View File

@@ -1,5 +1,5 @@
/* /*
* Copyright 2002-2011 the original author or authors. * Copyright 2002-2012 the original author or authors.
* *
* Licensed under the Apache License, Version 2.0 (the "License"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
@@ -20,11 +20,13 @@ import org.springframework.integration.file.FileHeaders;
/** /**
* @author Gary Russell * @author Gary Russell
* @author Gunnar Hillert
*
* @since 2.0.2 * @since 2.0.2
* *
*/ */
public interface VoidGateway { public interface VoidGateway {
public void process(String thing, @Header(FileHeaders.FILENAME) String fileName); public void process(String thing, @Header(FileHeaders.FILENAME) String fileName);
} }

View File

@@ -7,23 +7,23 @@ This example demonstrates the following aspects of the Twitter support available
2. Twitter Inbound Search Channel Adapter - allows you to receive HOME status updates 2. Twitter Inbound Search Channel Adapter - allows you to receive HOME status updates
3. Twitter Outboud Channel Adapter - allows send status updates 3. Twitter Outboud Channel Adapter - allows send status updates
In order to run this sample you need to configure OAuth and set the values in the OAuth properties. In order to run this sample you need to configure [OAuth][] and set the values in the [OAuth][] properties.
To use OAuth authentication/authorization with Twitter you must create new Application on Twitter Developers site. To use [OAuth][] authentication/authorization with Twitter you must create a new Application on the Twitter Developers site.
Follow the directions below to create a new application and obtain consumer keys and access token: Follow the directions below to create a new application and obtain the consumer keys and the access token:
* Go to http://dev.twitter.com/ * Go to [http://dev.twitter.com/](http://dev.twitter.com/)
* Click on 'Create an app' link and fill out all required fields on the form provided; * Log in to your account
* Set 'Application Type' to 'Client' and depending on the nature of your application * Go to *My applications*.
* Select 'Default Access Type' as 'Read & Write' or 'Read-only' * Click on 'Create a new application' link and fill out all required fields on the form provided;
* Submit the form. * Submit the form.
* If everything is successful you'll be presented with the 'Consumer Key' and 'Consumer Secret'. * If everything is successful you'll be presented with the 'Consumer Key' and 'Consumer Secret'.
* Copy both values in the safe place. * Copy both values to a safe place.
* On the same page you should see 'My Access Token' button on the side bar (right). * On the same page you should see 'My Access Token' button on bottom of the page.
* Click on it and you'll be presented with two more values: 'Access Token' and 'Access Token Secret'. * Click on it and you'll be presented with two more values: 'Access Token' and 'Access Token Secret'.
* Copy these values in a safe place as well. * Copy these values to a safe place as well.
When done fill out **oauth.properties** file so it looks similar to this. When done, fill out **oauth.properties** file so it looks similar to this.
twitter.oauth.consumerKey=4XzBPabcJQxyBzzzH3TrRQ twitter.oauth.consumerKey=4XzBPabcJQxyBzzzH3TrRQ
twitter.oauth.consumerSecret=ab2piKdMfPu8bVa3ab6DAIvIWEVZyMDL0RSEN2I8 twitter.oauth.consumerSecret=ab2piKdMfPu8bVa3ab6DAIvIWEVZyMDL0RSEN2I8
@@ -32,5 +32,7 @@ When done fill out **oauth.properties** file so it looks similar to this.
NOTE: the above values are not real ;) NOTE: the above values are not real ;)
Now you ready to execute samples. Just run each sample and look for the output produced by the inbound adapters (**TwitterSearchSample.java** and **TwitterTimelineUpdateSample.java**) Now you are ready to execute the samples. Just run each sample and look for the output produced by the inbound adapters (**TwitterSearchSample.java** and **TwitterTimelineUpdateSample.java**)
The outbound adapter sample (**TwitterSendUpdatesSample.java**) will not produce any output. Instead within seconds you should see your tweet. The outbound adapter sample (**TwitterSendUpdatesSample.java**) will not produce any output. Instead within seconds you should see your tweet.
[OAuth]: http://en.wikipedia.org/wiki/OAuth

View File

@@ -2,7 +2,7 @@
<modelVersion>4.0.0</modelVersion> <modelVersion>4.0.0</modelVersion>
<groupId>org.springframework.integration.samples</groupId> <groupId>org.springframework.integration.samples</groupId>
<artifactId>twitter</artifactId> <artifactId>twitter</artifactId>
<version>2.1.0.BUILD-SNAPSHOT</version> <version>2.2.0.BUILD-SNAPSHOT</version>
<name>Samples (Basic) - Twitter Demo</name> <name>Samples (Basic) - Twitter Demo</name>
<packaging>jar</packaging> <packaging>jar</packaging>
@@ -12,8 +12,8 @@
<properties> <properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<spring.integration.version>2.1.3.RELEASE</spring.integration.version> <spring.integration.version>2.2.0.RC3</spring.integration.version>
<log4j.version>1.2.16</log4j.version> <log4j.version>1.2.17</log4j.version>
<junit.version>4.10</junit.version> <junit.version>4.10</junit.version>
</properties> </properties>
<dependencies> <dependencies>
@@ -41,11 +41,11 @@
<artifactId>maven-compiler-plugin</artifactId> <artifactId>maven-compiler-plugin</artifactId>
<version>2.5.1</version> <version>2.5.1</version>
<configuration> <configuration>
<source>1.5</source> <source>1.6</source>
<target>1.5</target> <target>1.6</target>
<compilerArgument>-Xlint:all</compilerArgument> <compilerArgument>-Xlint:all</compilerArgument>
<showWarnings>true</showWarnings> <showWarnings>true</showWarnings>
<showDeprecation>false</showDeprecation> <showDeprecation>true</showDeprecation>
</configuration> </configuration>
</plugin> </plugin>
</plugins> </plugins>

View File

@@ -1,9 +1,9 @@
Web Service Inbound Gateway Sample Web Service Inbound Gateway Sample
================================== ==================================
This sample demonstrates a barebones *inbound Web Service Gateway*. Take a look at **web.xml** in the WEB-INF directory where the Spring Web Services Message-dispatching Servlet is defined. Then have a look at the **spring-ws-config.xml** file (also in the WEB-INF directory) where the Spring WS EndpointMapping is defined. Finally view the Spring Integration configuration in the **inbound-gateway-config.xml** file within the **org.springframework.integration.samples.ws** package where the actual gateway is defined along with a channel and service-activator. This sample demonstrates a barebones *inbound Web Service Gateway*. Take a look at **web.xml** in the **WEB-INF** directory where the [Spring Web Services][] Message-dispatching Servlet is defined. Then have a look at the **spring-ws-config.xml** file (also in the **WEB-INF** directory) where the Spring WS EndpointMapping is defined. Finally, view the *Spring Integration* configuration in the **inbound-gateway-config.xml** file within the **org.springframework.integration.samples.ws** package where the actual *Gateway* is defined along with a *Channel* and *Service Activator*.
To use the gateway, you can run the tests that are located within the **src/test/java** directory. One is for standalone testing of the gateway itself, while the other tests the gateway running on a web server. The latter uses Spring Web Services' client-side support. Alternatively, you can simply start the server, and then send invocations with any standalone HTTP client testing tool. The request format should be similar to the following and should be POSTed to the service URL (e.g. http://localhost:8080/ws-inbound-gateway/echoservice): To use the *Gateway*, you can run the tests that are located within the **src/test/java** directory. One is for standalone testing of the gateway itself, while the other tests the *Gateway* running on a web server. The latter uses [Spring Web Services][]' client-side support. Alternatively, you can simply start the server, and then send invocations with any standalone HTTP client testing tool. The request format should be similar to the following and should be *POST*ed to the service URL (e.g. http://localhost:8080/ws-inbound-gateway/echoservice):
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"> <SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/">
<SOAP-ENV:Header/> <SOAP-ENV:Header/>
@@ -11,3 +11,5 @@ To use the gateway, you can run the tests that are located within the **src/test
<echoRequest xmlns="http://www.springframework.org/spring-ws/samples/echo">hello</echoRequest> <echoRequest xmlns="http://www.springframework.org/spring-ws/samples/echo">hello</echoRequest>
</SOAP-ENV:Body> </SOAP-ENV:Body>
</SOAP-ENV:Envelope> </SOAP-ENV:Envelope>
[Spring Web Services]: http://www.springsource.org/spring-web-services

View File

@@ -5,13 +5,16 @@
<groupId>org.springframework.integration.samples</groupId> <groupId>org.springframework.integration.samples</groupId>
<artifactId>ws-inbound-gateway</artifactId> <artifactId>ws-inbound-gateway</artifactId>
<name>Samples (Basic) - WS Inbound Gateway Sample</name> <name>Samples (Basic) - WS Inbound Gateway Sample</name>
<version>2.1.0.BUILD-SNAPSHOT</version> <version>2.2.0.BUILD-SNAPSHOT</version>
<packaging>war</packaging> <packaging>war</packaging>
<prerequisites>
<maven>2.2.1</maven>
</prerequisites>
<properties> <properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<spring.integration.version>2.1.0.RELEASE</spring.integration.version> <spring.integration.version>2.2.0.RC3</spring.integration.version>
<spring.version>3.1.0.RELEASE</spring.version> <spring.version>3.1.3.RELEASE</spring.version>
<log4j.version>1.2.16</log4j.version> <log4j.version>1.2.17</log4j.version>
<junit.version>4.10</junit.version> <junit.version>4.10</junit.version>
</properties> </properties>
<dependencies> <dependencies>
@@ -47,13 +50,13 @@
<plugin> <plugin>
<groupId>org.apache.maven.plugins</groupId> <groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId> <artifactId>maven-compiler-plugin</artifactId>
<version>2.3.2</version> <version>2.5.1</version>
<configuration> <configuration>
<source>1.5</source> <source>1.6</source>
<target>1.5</target> <target>1.6</target>
<compilerArgument>-Xlint:all</compilerArgument> <compilerArgument>-Xlint:all</compilerArgument>
<showWarnings>true</showWarnings> <showWarnings>true</showWarnings>
<showDeprecation>false</showDeprecation> <showDeprecation>true</showDeprecation>
</configuration> </configuration>
</plugin> </plugin>
</plugins> </plugins>

View File

@@ -1,20 +1,26 @@
WS Outbound Gateway Sample WS Outbound Gateway Sample
========================== ==========================
This example demonstrates the following aspects of the WS support available with Spring Integration: This example demonstrates the following aspects of the Web Services (WS) support available with *Spring Integration*:
1. WS Outbound Gateway 1. WS Outbound Gateway
2. Content Enricher 2. Content Enricher
3. Composed Message Processor 3. Composed Message Processor
A very simple example that show you how easy it is to invoke a SOAP based service using Spring Integration. A very simple example that show you how easy it is to invoke a service based on the [Simple Object Access Protocol][] (SOAP) using *Spring Integration*.
* A Message is simply sent to a channel, where it is retrieved by a *Chain* which consists of a *Header Enricher* and a *WS Outbound Gateway*. * A *Message* is sent to a *Channel*, where it is retrieved by a *Chain* which consists of a *Header Enricher* and a *WS Outbound Gateway*.
* The *Header Enricher* enriches the Message with the SOAP action header. * The *Header Enricher* enriches the *Message* with the SOAP action header.
* The *WS Outbound Gateway* converts the Message to a SOAP request and sends it to a remote service, which converts a temperature from * The *WS Outbound Gateway* converts the *Message* to a SOAP request and sends it to a remote service, which converts a temperature from
Fahrenheit to Celsius and the result is printed to the console. Fahrenheit (90F) to Celsius (32.2C) and the result is printed to the console:
````
<?xml version="1.0" encoding="UTF-8"?><FahrenheitToCelsiusResponse xmlns="http://tempuri.org/"><FahrenheitToCelsiusResult>32.2222222222222</FahrenheitToCelsiusResult></FahrenheitToCelsiusResponse>````
## Running the Sample
To run the sample simply execute **WebServiceDemoTestApp** in package *org.springframework.integration.samples.ws*. You can also execute that class using the [Exec Maven Plugin](http://mojo.codehaus.org/exec-maven-plugin/): To run the sample simply execute **WebServiceDemoTestApp** in package *org.springframework.integration.samples.ws*. You can also execute that class using the [Exec Maven Plugin](http://mojo.codehaus.org/exec-maven-plugin/):
$ mvn clean package exec:java $ mvn clean package exec:java
[Simple Object Access Protocol]: http://en.wikipedia.org/wiki/SOAP

View File

@@ -5,14 +5,17 @@
<groupId>org.springframework.integration.samples</groupId> <groupId>org.springframework.integration.samples</groupId>
<artifactId>ws-outbound-gateway</artifactId> <artifactId>ws-outbound-gateway</artifactId>
<name>Samples (Basic) - WS Outbound Gateway Sample</name> <name>Samples (Basic) - WS Outbound Gateway Sample</name>
<version>2.1.0.BUILD-SNAPSHOT</version> <version>2.2.0.BUILD-SNAPSHOT</version>
<packaging>jar</packaging> <packaging>jar</packaging>
<prerequisites>
<maven>2.2.1</maven>
</prerequisites>
<properties> <properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<spring.integration.version>2.1.0.RELEASE</spring.integration.version> <spring.integration.version>2.2.0.RC3</spring.integration.version>
<log4j.version>1.2.16</log4j.version> <log4j.version>1.2.17</log4j.version>
<junit.version>4.10</junit.version> <junit.version>4.10</junit.version>
<saaj.version>1.3</saaj.version> <saaj.version>1.3.19</saaj.version>
<javax-activation.version>1.1.1</javax-activation.version> <javax-activation.version>1.1.1</javax-activation.version>
</properties> </properties>
<dependencies> <dependencies>
@@ -53,23 +56,23 @@
<plugin> <plugin>
<groupId>org.apache.maven.plugins</groupId> <groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId> <artifactId>maven-compiler-plugin</artifactId>
<version>2.3.2</version> <version>2.5.1</version>
<configuration> <configuration>
<source>1.5</source> <source>1.6</source>
<target>1.5</target> <target>1.6</target>
<compilerArgument>-Xlint:all</compilerArgument> <compilerArgument>-Xlint:all</compilerArgument>
<showWarnings>true</showWarnings> <showWarnings>true</showWarnings>
<showDeprecation>false</showDeprecation> <showDeprecation>true</showDeprecation>
</configuration>
</plugin>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>exec-maven-plugin</artifactId>
<version>1.2.1</version>
<configuration>
<mainClass>org.springframework.integration.samples.ws.WebServiceDemoTestApp</mainClass>
</configuration> </configuration>
</plugin> </plugin>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>exec-maven-plugin</artifactId>
<version>1.2</version>
<configuration>
<mainClass>org.springframework.integration.samples.ws.WebServiceDemoTestApp</mainClass>
</configuration>
</plugin>
</plugins> </plugins>
</build> </build>
<repositories> <repositories>

View File

@@ -1,14 +1,16 @@
XML Sample XML Sample
========== ==========
This example demonstrates the following aspects of the XML support available with Spring Integration: This example demonstrates the following aspects of the [Extensible Markup Language][] (XML) support available with *Spring Integration*:
1. XPath Splitter - to split an order with multiple items into several order messages for separate processing. 1. [XPath][] Splitter - to split an order with multiple items into several order messages for separate processing.
2. XPath Router - to route messages according to the evaluation of an XPath expression which tests to see if the order item is in stock. 2. [XPath][] Router - to route messages according to the evaluation of an [XPath][] expression which tests to see if the order item is in stock.
3. XPath Expression - which tests to see if the order item is in stock 3. [XPath][] Expression - which tests to see if the order item is in stock
3. XSLT Transformer - to transform the payload of the order message into a resupply message where the order item is found to be out of stock. 3. [XSLT][] Transformer - to transform the payload of the order message into a resupply message where the order item is found to be out of stock.
To run the sample execute class **org.springframework.integration.samples.xml.BookOrderProcessingTestApp**. With Maven you can run the sample by executing: ## Running the Sample
To run the sample, execute the class **org.springframework.integration.samples.xml.BookOrderProcessingTestApp**. Alternatively, you can run the sample using [Maven][] by executing:
$ mvn clean package exec:java $ mvn clean package exec:java
@@ -31,4 +33,8 @@ You should see the following output:
<bb:isbn>1590596439</bb:isbn> <bb:isbn>1590596439</bb:isbn>
</bb:order> </bb:order>
</bb:bigBooksOrder> </bb:bigBooksOrder>
[Extensible Markup Language]: http://en.wikipedia.org/wiki/XML
[Maven]: http://maven.apache.org/
[XPath]: http://en.wikipedia.org/wiki/XPath
[XSLT]: http://en.wikipedia.org/wiki/XSLT

View File

@@ -5,12 +5,15 @@
<groupId>org.springframework.integration.samples</groupId> <groupId>org.springframework.integration.samples</groupId>
<artifactId>xml</artifactId> <artifactId>xml</artifactId>
<name>Samples (Basic) - XML Sample</name> <name>Samples (Basic) - XML Sample</name>
<version>2.1.0.BUILD-SNAPSHOT</version> <version>2.2.0.BUILD-SNAPSHOT</version>
<packaging>jar</packaging> <packaging>jar</packaging>
<prerequisites>
<maven>2.2.1</maven>
</prerequisites>
<properties> <properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<spring.integration.version>2.1.0.RELEASE</spring.integration.version> <spring.integration.version>2.2.0.RC3</spring.integration.version>
<log4j.version>1.2.16</log4j.version> <log4j.version>1.2.17</log4j.version>
<junit.version>4.10</junit.version> <junit.version>4.10</junit.version>
</properties> </properties>
<dependencies> <dependencies>
@@ -36,23 +39,23 @@
<plugin> <plugin>
<groupId>org.apache.maven.plugins</groupId> <groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId> <artifactId>maven-compiler-plugin</artifactId>
<version>2.3.2</version> <version>2.5.1</version>
<configuration> <configuration>
<source>1.5</source> <source>1.6</source>
<target>1.5</target> <target>1.6</target>
<compilerArgument>-Xlint:all</compilerArgument> <compilerArgument>-Xlint:all</compilerArgument>
<showWarnings>true</showWarnings> <showWarnings>true</showWarnings>
<showDeprecation>false</showDeprecation> <showDeprecation>true</showDeprecation>
</configuration>
</plugin>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>exec-maven-plugin</artifactId>
<version>1.2.1</version>
<configuration>
<mainClass>org.springframework.integration.samples.xml.BookOrderProcessingTestApp</mainClass>
</configuration> </configuration>
</plugin> </plugin>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>exec-maven-plugin</artifactId>
<version>1.2</version>
<configuration>
<mainClass>org.springframework.integration.samples.xml.BookOrderProcessingTestApp</mainClass>
</configuration>
</plugin>
</plugins> </plugins>
</build> </build>
<repositories> <repositories>

View File

@@ -1,7 +1,7 @@
XMPP Sample XMPP Sample
=========== ===========
This example was prepared for testing with GoogleTalk and demonstrates the following aspects of the *Extensible Messaging and Presence Protocol* (XMPP) support available with Spring Integration: 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*:
1. XMPP Inbound Channel Adapter - receive instant messages. 1. XMPP Inbound Channel Adapter - receive instant messages.
2. XMPP Outboud Channel Adapter - send instant messages. 2. XMPP Outboud Channel Adapter - send instant messages.
@@ -16,4 +16,7 @@ Everything there was already preset. The only 3 properties you need to provide v
You'll also need to test it with your friend or have two Google accounts setup. You'll also need to test it with your friend or have two Google accounts setup.
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. 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.
To test **ReceiveInstantMessageSample.java**, first log on to the account identified via **send.to.user** property. Then run the demo. When demo class is started you'll see on GoggleTalk that your buddy (ReceiveInstantMessageSample.java) has just signed on. Now you can send a message from GoogleTalk and see it appear ion the console. 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.
[Google Talk]: http://www.google.com/talk/
[Extensible Messaging and Presence Protocol]: http://en.wikipedia.org/wiki/Extensible_Messaging_and_Presence_Protocol

View File

@@ -2,13 +2,18 @@
<modelVersion>4.0.0</modelVersion> <modelVersion>4.0.0</modelVersion>
<groupId>org.springframework.integration.samples</groupId> <groupId>org.springframework.integration.samples</groupId>
<artifactId>xmpp</artifactId> <artifactId>xmpp</artifactId>
<version>2.1.0.BUILD-SNAPSHOT</version> <version>2.2.0.BUILD-SNAPSHOT</version>
<name>Samples (Basic) - XMPP Demo</name> <name>Samples (Basic) - XMPP Demo</name>
<packaging>jar</packaging> <packaging>jar</packaging>
<prerequisites>
<maven>2.2.1</maven>
</prerequisites>
<properties> <properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<spring.integration.version>2.1.0.RELEASE</spring.integration.version> <spring.integration.version>2.2.0.RC3</spring.integration.version>
<log4j.version>1.2.16</log4j.version> <log4j.version>1.2.17</log4j.version>
<junit.version>4.10</junit.version> <junit.version>4.10</junit.version>
</properties> </properties>
<dependencies> <dependencies>
@@ -34,13 +39,13 @@
<plugin> <plugin>
<groupId>org.apache.maven.plugins</groupId> <groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId> <artifactId>maven-compiler-plugin</artifactId>
<version>2.3.2</version> <version>2.5.1</version>
<configuration> <configuration>
<source>1.5</source> <source>1.6</source>
<target>1.5</target> <target>1.6</target>
<compilerArgument>-Xlint:all</compilerArgument> <compilerArgument>-Xlint:all</compilerArgument>
<showWarnings>true</showWarnings> <showWarnings>true</showWarnings>
<showDeprecation>false</showDeprecation> <showDeprecation>true</showDeprecation>
</configuration> </configuration>
</plugin> </plugin>
</plugins> </plugins>

View File

@@ -8,18 +8,18 @@
xmlns:context="http://www.springframework.org/schema/context" xmlns:context="http://www.springframework.org/schema/context"
xmlns:int="http://www.springframework.org/schema/integration" xmlns:int="http://www.springframework.org/schema/integration"
xmlns:int-xmpp="http://www.springframework.org/schema/integration/xmpp"> xmlns:int-xmpp="http://www.springframework.org/schema/integration/xmpp">
<context:property-placeholder location="classpath:xmpp.properties"/> <context:property-placeholder location="classpath:xmpp.properties"/>
<int-xmpp:xmpp-connection id="googleTalkConnection" <int-xmpp:xmpp-connection id="googleTalkConnection"
user="${user.login}" user="${user.login}"
password="${user.password}" password="${user.password}"
host="${user.host}" host="${user.host}"
service-name="${user.service}" service-name="${user.service}"
port="${user.port}"/> port="${user.port}"/>
<int-xmpp:inbound-channel-adapter channel="imOutChannel" xmpp-connection="googleTalkConnection"/> <int-xmpp:inbound-channel-adapter channel="imOutChannel" xmpp-connection="googleTalkConnection"/>
<int:logging-channel-adapter id="imOutChannel"/> <int:logging-channel-adapter id="imOutChannel"/>
</beans> </beans>

View File

@@ -8,24 +8,24 @@
xmlns:context="http://www.springframework.org/schema/context" xmlns:context="http://www.springframework.org/schema/context"
xmlns:int="http://www.springframework.org/schema/integration" xmlns:int="http://www.springframework.org/schema/integration"
xmlns:int-xmpp="http://www.springframework.org/schema/integration/xmpp"> xmlns:int-xmpp="http://www.springframework.org/schema/integration/xmpp">
<context:property-placeholder location="classpath:xmpp.properties"/> <context:property-placeholder location="classpath:xmpp.properties"/>
<int-xmpp:xmpp-connection id="googleTalkConnection" <int-xmpp:xmpp-connection id="googleTalkConnection"
user="${user.login}" user="${user.login}"
password="${user.password}" password="${user.password}"
host="${user.host}" host="${user.host}"
service-name="${user.service}" service-name="${user.service}"
port="${user.port}"/> port="${user.port}"/>
<int:channel id="toUserChannel"/> <int:channel id="toUserChannel"/>
<int-xmpp:header-enricher input-channel="toUserChannel" output-channel="imChannel"> <int-xmpp:header-enricher input-channel="toUserChannel" output-channel="imChannel">
<int-xmpp:chat-to value="${send.to.user}"/> <int-xmpp:chat-to value="${send.to.user}"/>
</int-xmpp:header-enricher> </int-xmpp:header-enricher>
<int:channel id="imChannel"/> <int:channel id="imChannel"/>
<int-xmpp:outbound-channel-adapter channel="imChannel" xmpp-connection="googleTalkConnection"/> <int-xmpp:outbound-channel-adapter channel="imChannel" xmpp-connection="googleTalkConnection"/>
</beans> </beans>

View File

@@ -12,7 +12,7 @@
<!-- Loggers --> <!-- Loggers -->
<logger name="org.springframework.integration"> <logger name="org.springframework.integration">
<level value="warn" /> <level value="info" />
</logger> </logger>
<logger name="org.springframework.integration.samples"> <logger name="org.springframework.integration.samples">

View File

@@ -7,7 +7,7 @@
<version>1.0.0.BUILD-SNAPSHOT</version> <version>1.0.0.BUILD-SNAPSHOT</version>
<packaging>jar</packaging> <packaging>jar</packaging>
<name>xquery</name> <name>Samples (Basic) - XQuery Sample</name>
<url>http://www.springsource.org/spring-integration</url> <url>http://www.springsource.org/spring-integration</url>
<prerequisites> <prerequisites>
@@ -16,7 +16,7 @@
<properties> <properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<spring.integration.version>2.2.0.RC2</spring.integration.version> <spring.integration.version>2.2.0.RC3</spring.integration.version>
<log4j.version>1.2.17</log4j.version> <log4j.version>1.2.17</log4j.version>
<junit.version>4.10</junit.version> <junit.version>4.10</junit.version>
</properties> </properties>

View File

@@ -3,13 +3,18 @@
<modelVersion>4.0.0</modelVersion> <modelVersion>4.0.0</modelVersion>
<groupId>org.springframework.integration.samples</groupId> <groupId>org.springframework.integration.samples</groupId>
<artifactId>async-gateway</artifactId> <artifactId>async-gateway</artifactId>
<version>2.1.0.BUILD-SNAPSHOT</version> <version>2.2.0.BUILD-SNAPSHOT</version>
<name>Samples (Intermediate) - Async Gateway Demo</name> <name>Samples (Intermediate) - Async Gateway Demo</name>
<packaging>jar</packaging> <packaging>jar</packaging>
<prerequisites>
<maven>2.2.1</maven>
</prerequisites>
<properties> <properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<spring.integration.version>2.1.0.RELEASE</spring.integration.version> <spring.integration.version>2.2.0.RC3</spring.integration.version>
<log4j.version>1.2.16</log4j.version> <log4j.version>1.2.17</log4j.version>
<junit.version>4.10</junit.version> <junit.version>4.10</junit.version>
</properties> </properties>
<dependencies> <dependencies>
@@ -35,13 +40,13 @@
<plugin> <plugin>
<groupId>org.apache.maven.plugins</groupId> <groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId> <artifactId>maven-compiler-plugin</artifactId>
<version>2.3.2</version> <version>2.5.1</version>
<configuration> <configuration>
<source>1.5</source> <source>1.6</source>
<target>1.5</target> <target>1.6</target>
<compilerArgument>-Xlint:all</compilerArgument> <compilerArgument>-Xlint:all</compilerArgument>
<showWarnings>true</showWarnings> <showWarnings>true</showWarnings>
<showDeprecation>false</showDeprecation> <showDeprecation>true</showDeprecation>
</configuration> </configuration>
</plugin> </plugin>
</plugins> </plugins>

View File

@@ -1,65 +1,69 @@
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion> <modelVersion>4.0.0</modelVersion>
<groupId>org.springframework.integration.samples</groupId> <groupId>org.springframework.integration.samples</groupId>
<artifactId>dynamic-poller</artifactId> <artifactId>dynamic-poller</artifactId>
<version>2.1.0.BUILD-SNAPSHOT</version> <version>2.2.0.BUILD-SNAPSHOT</version>
<packaging>jar</packaging> <packaging>jar</packaging>
<name>dynamic-poller</name> <name>dynamic-poller</name>
<url>http://www.springsource.org/spring-integration</url> <url>http://www.springsource.org/spring-integration</url>
<properties> <prerequisites>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> <maven>2.2.1</maven>
<spring.integration.version>2.1.0.RELEASE</spring.integration.version> </prerequisites>
<log4j.version>1.2.16</log4j.version>
<junit.version>4.10</junit.version>
<java.main.class>org.springframework.integration.samples.poller.Main</java.main.class>
</properties>
<dependencies> <properties>
<dependency> <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<groupId>org.springframework.integration</groupId> <spring.integration.version>2.2.0.RC3</spring.integration.version>
<artifactId>spring-integration-core</artifactId> <log4j.version>1.2.17</log4j.version>
<version>${spring.integration.version}</version> <junit.version>4.10</junit.version>
</dependency> <java.main.class>org.springframework.integration.samples.poller.Main</java.main.class>
<dependency> </properties>
<groupId>log4j</groupId>
<artifactId>log4j</artifactId> <dependencies>
<version>${log4j.version}</version> <dependency>
</dependency> <groupId>org.springframework.integration</groupId>
<!-- test-scoped dependencies --> <artifactId>spring-integration-core</artifactId>
<dependency> <version>${spring.integration.version}</version>
<groupId>junit</groupId> </dependency>
<artifactId>junit</artifactId> <dependency>
<version>${junit.version}</version> <groupId>log4j</groupId>
</dependency> <artifactId>log4j</artifactId>
</dependencies> <version>${log4j.version}</version>
<build> </dependency>
<plugins> <!-- test-scoped dependencies -->
<plugin> <dependency>
<groupId>org.apache.maven.plugins</groupId> <groupId>junit</groupId>
<artifactId>maven-compiler-plugin</artifactId> <artifactId>junit</artifactId>
<version>2.3.2</version> <version>${junit.version}</version>
<configuration> </dependency>
<source>1.5</source> </dependencies>
<target>1.5</target> <build>
<compilerArgument>-Xlint:all</compilerArgument> <plugins>
<showWarnings>true</showWarnings> <plugin>
<showDeprecation>true</showDeprecation> <groupId>org.apache.maven.plugins</groupId>
</configuration> <artifactId>maven-compiler-plugin</artifactId>
</plugin> <version>2.5.1</version>
<plugin> <configuration>
<groupId>org.codehaus.mojo</groupId> <source>1.6</source>
<artifactId>exec-maven-plugin</artifactId> <target>1.6</target>
<version>1.2</version> <compilerArgument>-Xlint:all</compilerArgument>
<configuration> <showWarnings>true</showWarnings>
<mainClass>${java.main.class}</mainClass> <showDeprecation>true</showDeprecation>
</configuration> </configuration>
</plugin> </plugin>
</plugins> <plugin>
</build> <groupId>org.codehaus.mojo</groupId>
<artifactId>exec-maven-plugin</artifactId>
<version>1.2</version>
<configuration>
<mainClass>${java.main.class}</mainClass>
</configuration>
</plugin>
</plugins>
</build>
<repositories> <repositories>
<repository> <repository>
<id>repo.springsource.org.milestone</id> <id>repo.springsource.org.milestone</id>
@@ -67,4 +71,4 @@
<url>https://repo.springsource.org/libs-milestone</url> <url>https://repo.springsource.org/libs-milestone</url>
</repository> </repository>
</repositories> </repositories>
</project> </project>

View File

@@ -1,21 +1,26 @@
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans" <beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
http://www.springframework.org/schema/integration http://www.springframework.org/schema/integration/spring-integration-2.1.xsd http://www.springframework.org/schema/integration http://www.springframework.org/schema/integration/spring-integration.xsd
http://www.springframework.org/schema/task http://www.springframework.org/schema/task/spring-task.xsd" http://www.springframework.org/schema/task http://www.springframework.org/schema/task/spring-task.xsd"
xmlns:int="http://www.springframework.org/schema/integration" xmlns:int="http://www.springframework.org/schema/integration"
xmlns:task="http://www.springframework.org/schema/task"> xmlns:task="http://www.springframework.org/schema/task">
<int:inbound-channel-adapter expression="new java.text.SimpleDateFormat('yyyy-MM-dd HH:mm:ss.SSS').format(new java.util.Date())" channel="logger"> <int:inbound-channel-adapter
<int:poller max-messages-per-poll="1" trigger="dynamicTrigger" /> expression="new java.text.SimpleDateFormat('yyyy-MM-dd HH:mm:ss.SSS').format(new java.util.Date())"
</int:inbound-channel-adapter> channel="logger">
<int:poller max-messages-per-poll="1" trigger="dynamicTrigger" />
</int:inbound-channel-adapter>
<bean id="dynamicTrigger" class="org.springframework.integration.samples.poller.DynamicPeriodicTrigger"> <bean id="dynamicTrigger"
<constructor-arg name="period" value="5000"/> class="org.springframework.integration.samples.poller.DynamicPeriodicTrigger">
</bean> <constructor-arg name="period" value="5000" />
</bean>
<int:logging-channel-adapter id="logger" logger-name="org.springframework.integration.samples.poller"/> <int:logging-channel-adapter id="logger"
logger-name="org.springframework.integration.samples.poller" />
<task:executor id="executor" queue-capacity="20" pool-size="5-20"/> <task:executor id="executor" queue-capacity="20"
pool-size="5-20" />
</beans> </beans>

View File

@@ -5,11 +5,16 @@
<groupId>org.springframework.integration.samples</groupId> <groupId>org.springframework.integration.samples</groupId>
<artifactId>errorhandling</artifactId> <artifactId>errorhandling</artifactId>
<name>Samples (Intermediate) - Error Handling Sample</name> <name>Samples (Intermediate) - Error Handling Sample</name>
<version>2.1.0.BUILD-SNAPSHOT</version> <version>2.2.0.BUILD-SNAPSHOT</version>
<prerequisites>
<maven>2.2.1</maven>
</prerequisites>
<properties> <properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<spring.integration.version>2.1.0.RELEASE</spring.integration.version> <spring.integration.version>2.2.0.RC3</spring.integration.version>
<log4j.version>1.2.16</log4j.version> <log4j.version>1.2.17</log4j.version>
<junit.version>4.10</junit.version> <junit.version>4.10</junit.version>
</properties> </properties>
<dependencies> <dependencies>
@@ -40,13 +45,13 @@
<plugin> <plugin>
<groupId>org.apache.maven.plugins</groupId> <groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId> <artifactId>maven-compiler-plugin</artifactId>
<version>2.3.2</version> <version>2.5.1</version>
<configuration> <configuration>
<source>1.5</source> <source>1.6</source>
<target>1.5</target> <target>1.6</target>
<compilerArgument>-Xlint:all</compilerArgument> <compilerArgument>-Xlint:all</compilerArgument>
<showWarnings>true</showWarnings> <showWarnings>true</showWarnings>
<showDeprecation>false</showDeprecation> <showDeprecation>true</showDeprecation>
</configuration> </configuration>
</plugin> </plugin>
</plugins> </plugins>

View File

@@ -2,15 +2,20 @@
<modelVersion>4.0.0</modelVersion> <modelVersion>4.0.0</modelVersion>
<groupId>org.springframework.integration.samples</groupId> <groupId>org.springframework.integration.samples</groupId>
<artifactId>file-processing</artifactId> <artifactId>file-processing</artifactId>
<version>2.1.0.BUILD-SNAPSHOT</version> <version>2.2.0.BUILD-SNAPSHOT</version>
<name>Samples (Intermediate) - File Processing</name> <name>Samples (Intermediate) - File Processing</name>
<properties> <properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<spring.integration.version>2.1.0.RELEASE</spring.integration.version> <spring.integration.version>2.2.0.RC3</spring.integration.version>
<log4j.version>1.2.16</log4j.version> <log4j.version>1.2.17</log4j.version>
<junit.version>4.10</junit.version> <junit.version>4.10</junit.version>
</properties> </properties>
<prerequisites>
<maven>2.2.1</maven>
</prerequisites>
<dependencies> <dependencies>
<dependency> <dependency>
<groupId>org.springframework.integration</groupId> <groupId>org.springframework.integration</groupId>
@@ -34,13 +39,13 @@
<plugin> <plugin>
<groupId>org.apache.maven.plugins</groupId> <groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId> <artifactId>maven-compiler-plugin</artifactId>
<version>2.3.2</version> <version>2.5.1</version>
<configuration> <configuration>
<source>1.5</source> <source>1.6</source>
<target>1.5</target> <target>1.6</target>
<compilerArgument>-Xlint:all</compilerArgument> <compilerArgument>-Xlint:all</compilerArgument>
<showWarnings>true</showWarnings> <showWarnings>true</showWarnings>
<showDeprecation>false</showDeprecation> <showDeprecation>true</showDeprecation>
</configuration> </configuration>
</plugin> </plugin>
</plugins> </plugins>

View File

@@ -8,7 +8,7 @@
<properties> <properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<spring.integration.version>2.2.0.RC1</spring.integration.version> <spring.integration.version>2.2.0.RC3</spring.integration.version>
<log4j.version>1.2.17</log4j.version> <log4j.version>1.2.17</log4j.version>
<junit.version>4.10</junit.version> <junit.version>4.10</junit.version>
</properties> </properties>
@@ -53,7 +53,7 @@
<dependency> <dependency>
<groupId>org.springframework</groupId> <groupId>org.springframework</groupId>
<artifactId>spring-test</artifactId> <artifactId>spring-test</artifactId>
<version>3.1.1.RELEASE</version> <version>3.1.3.RELEASE</version>
<scope>test</scope> <scope>test</scope>
</dependency> </dependency>
<dependency> <dependency>

View File

@@ -1,26 +1,26 @@
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion> <modelVersion>4.0.0</modelVersion>
<groupId>org.springframework.integration.sample</groupId> <groupId>org.springframework.integration.sample</groupId>
<artifactId>monitoring</artifactId> <artifactId>monitoring</artifactId>
<version>2.2.0.BUILD-SNAPSHOT</version> <version>2.2.0.BUILD-SNAPSHOT</version>
<packaging>war</packaging> <packaging>war</packaging>
<name>monitoring</name> <name>monitoring</name>
<url>http://www.springsource.org/spring-integration</url> <url>http://www.springsource.org/spring-integration</url>
<prerequisites> <prerequisites>
<maven>2.2.0</maven> <maven>2.2.1</maven>
</prerequisites> </prerequisites>
<properties> <properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<spring.integration.version>2.2.0.RC1</spring.integration.version> <spring.integration.version>2.2.0.RC3</spring.integration.version>
<org.springframework-version>3.1.1.RELEASE</org.springframework-version> <org.springframework-version>3.1.3.RELEASE</org.springframework-version>
<log4j.version>1.2.16</log4j.version> <log4j.version>1.2.17</log4j.version>
<junit.version>4.10</junit.version> <junit.version>4.10</junit.version>
</properties> </properties>
<repositories> <repositories>
<repository> <repository>
@@ -30,90 +30,90 @@
</repository> </repository>
</repositories> </repositories>
<build> <build>
<plugins> <plugins>
<plugin> <plugin>
<artifactId>maven-eclipse-plugin</artifactId> <artifactId>maven-eclipse-plugin</artifactId>
<version>2.9</version> <version>2.9</version>
<configuration> <configuration>
<additionalProjectnatures> <additionalProjectnatures>
<projectnature>org.springframework.ide.eclipse.core.springnature</projectnature> <projectnature>org.springframework.ide.eclipse.core.springnature</projectnature>
</additionalProjectnatures> </additionalProjectnatures>
<additionalBuildcommands> <additionalBuildcommands>
<buildcommand>org.springframework.ide.eclipse.core.springbuilder</buildcommand> <buildcommand>org.springframework.ide.eclipse.core.springbuilder</buildcommand>
</additionalBuildcommands> </additionalBuildcommands>
<downloadSources>true</downloadSources> <downloadSources>true</downloadSources>
<downloadJavadocs>true</downloadJavadocs> <downloadJavadocs>true</downloadJavadocs>
<wtpversion>1.5</wtpversion> <wtpversion>1.5</wtpversion>
</configuration> </configuration>
</plugin> </plugin>
<plugin> <plugin>
<groupId>org.apache.maven.plugins</groupId> <groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId> <artifactId>maven-compiler-plugin</artifactId>
<version>2.3.2</version> <version>2.5.1</version>
<configuration> <configuration>
<source>1.6</source> <source>1.6</source>
<target>1.6</target> <target>1.6</target>
<compilerArgument>-Xlint:all</compilerArgument> <compilerArgument>-Xlint:all</compilerArgument>
<showWarnings>true</showWarnings> <showWarnings>true</showWarnings>
<showDeprecation>true</showDeprecation> <showDeprecation>true</showDeprecation>
</configuration> </configuration>
</plugin> </plugin>
</plugins> </plugins>
</build> </build>
<dependencies> <dependencies>
<!-- Testing --> <!-- Testing -->
<dependency> <dependency>
<groupId>junit</groupId> <groupId>junit</groupId>
<artifactId>junit</artifactId> <artifactId>junit</artifactId>
<version>${junit.version}</version> <version>${junit.version}</version>
<scope>test</scope> <scope>test</scope>
</dependency> </dependency>
<!-- Spring --> <!-- Spring -->
<dependency> <dependency>
<groupId>org.springframework</groupId> <groupId>org.springframework</groupId>
<artifactId>spring-context</artifactId> <artifactId>spring-context</artifactId>
<version>${org.springframework-version}</version> <version>${org.springframework-version}</version>
</dependency> </dependency>
<dependency> <dependency>
<groupId>org.springframework</groupId> <groupId>org.springframework</groupId>
<artifactId>spring-webmvc</artifactId> <artifactId>spring-webmvc</artifactId>
<version>${org.springframework-version}</version> <version>${org.springframework-version}</version>
</dependency> </dependency>
<!-- Spring Integration --> <!-- Spring Integration -->
<dependency> <dependency>
<groupId>org.springframework.integration</groupId> <groupId>org.springframework.integration</groupId>
<artifactId>spring-integration-core</artifactId> <artifactId>spring-integration-core</artifactId>
<version>${spring.integration.version}</version> <version>${spring.integration.version}</version>
</dependency> </dependency>
<dependency> <dependency>
<groupId>org.springframework.integration</groupId> <groupId>org.springframework.integration</groupId>
<artifactId>spring-integration-jmx</artifactId> <artifactId>spring-integration-jmx</artifactId>
<version>${spring.integration.version}</version> <version>${spring.integration.version}</version>
</dependency> </dependency>
<dependency> <dependency>
<groupId>org.springframework.integration</groupId> <groupId>org.springframework.integration</groupId>
<artifactId>spring-integration-twitter</artifactId> <artifactId>spring-integration-twitter</artifactId>
<version>${spring.integration.version}</version> <version>${spring.integration.version}</version>
</dependency> </dependency>
<dependency> <dependency>
<groupId>org.springframework.integration</groupId> <groupId>org.springframework.integration</groupId>
<artifactId>spring-integration-groovy</artifactId> <artifactId>spring-integration-groovy</artifactId>
<version>${spring.integration.version}</version> <version>${spring.integration.version}</version>
</dependency> </dependency>
<!-- Logging --> <!-- Logging -->
<dependency> <dependency>
<groupId>log4j</groupId> <groupId>log4j</groupId>
@@ -121,24 +121,24 @@
<version>${log4j.version}</version> <version>${log4j.version}</version>
</dependency> </dependency>
<!-- Servlet --> <!-- Servlet -->
<dependency> <dependency>
<groupId>javax.servlet</groupId> <groupId>javax.servlet</groupId>
<artifactId>servlet-api</artifactId> <artifactId>servlet-api</artifactId>
<version>2.5</version> <version>2.5</version>
<scope>provided</scope> <scope>provided</scope>
</dependency> </dependency>
<dependency> <dependency>
<groupId>javax.servlet.jsp</groupId> <groupId>javax.servlet.jsp</groupId>
<artifactId>jsp-api</artifactId> <artifactId>jsp-api</artifactId>
<version>2.1</version> <version>2.1</version>
<scope>provided</scope> <scope>provided</scope>
</dependency> </dependency>
<dependency> <dependency>
<groupId>javax.servlet</groupId> <groupId>javax.servlet</groupId>
<artifactId>jstl</artifactId> <artifactId>jstl</artifactId>
<version>1.2</version> <version>1.2</version>
</dependency> </dependency>
</dependencies> </dependencies>
</project> </project>

View File

@@ -3,32 +3,32 @@
<modelVersion>4.0.0</modelVersion> <modelVersion>4.0.0</modelVersion>
<groupId>org.springframework.integration.samples</groupId> <groupId>org.springframework.integration.samples</groupId>
<artifactId>multipart-http</artifactId> <artifactId>multipart-http</artifactId>
<version>2.1.0.BUILD-SNAPSHOT</version> <version>2.2.0.BUILD-SNAPSHOT</version>
<name>Samples (Intermediate) - HTTP Multipart Demo</name> <name>Samples (Intermediate) - HTTP Multipart Demo</name>
<packaging>war</packaging> <packaging>war</packaging>
<properties> <properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<spring.integration.version>2.1.0.RELEASE</spring.integration.version> <spring.integration.version>2.2.0.RC3</spring.integration.version>
<spring.version>3.1.0.RELEASE</spring.version> <spring.version>3.1.3.RELEASE</spring.version>
<commons-fileupload>1.2</commons-fileupload> <commons-fileupload>1.2.2</commons-fileupload>
<commons-io>1.3.2</commons-io> <commons-io>1.3.2</commons-io>
<log4j.version>1.2.16</log4j.version> <log4j.version>1.2.17</log4j.version>
</properties> </properties>
<prerequisites>
<maven>2.2.1</maven>
</prerequisites>
<dependencies> <dependencies>
<dependency> <dependency>
<groupId>org.springframework.integration</groupId> <groupId>org.springframework.integration</groupId>
<artifactId>spring-integration-http</artifactId> <artifactId>spring-integration-http</artifactId>
<version>${spring.integration.version}</version> <version>${spring.integration.version}</version>
</dependency> </dependency>
<!-- <dependency> -->
<!-- <groupId>org.codehaus.jackson</groupId> -->
<!-- <artifactId>jackson-core-asl</artifactId> -->
<!-- <version>1.8.1</version> -->
<!-- </dependency> -->
<dependency> <dependency>
<groupId>org.codehaus.jackson</groupId> <groupId>org.codehaus.jackson</groupId>
<artifactId>jackson-mapper-asl</artifactId> <artifactId>jackson-mapper-asl</artifactId>
<version>1.9.2</version> <version>1.9.10</version>
<scope>compile</scope> <scope>compile</scope>
<optional>true</optional> <optional>true</optional>
</dependency> </dependency>
@@ -63,13 +63,13 @@
<plugin> <plugin>
<groupId>org.apache.maven.plugins</groupId> <groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId> <artifactId>maven-compiler-plugin</artifactId>
<version>2.3.2</version> <version>2.5.1</version>
<configuration> <configuration>
<source>1.5</source> <source>1.6</source>
<target>1.5</target> <target>1.6</target>
<compilerArgument>-Xlint:all</compilerArgument> <compilerArgument>-Xlint:all</compilerArgument>
<showWarnings>true</showWarnings> <showWarnings>true</showWarnings>
<showDeprecation>false</showDeprecation> <showDeprecation>true</showDeprecation>
</configuration> </configuration>
</plugin> </plugin>
</plugins> </plugins>

View File

@@ -1,5 +1,17 @@
/** /*
* * Copyright 2002-2012 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/ */
package org.springframework.integration.samples.multipart; package org.springframework.integration.samples.multipart;
@@ -9,9 +21,10 @@ import org.springframework.http.HttpStatus;
/** /**
* @author ozhurakousky * @author ozhurakousky
* @author Gunnar Hillert
* *
*/ */
public interface MultipartRequestGateway { public interface MultipartRequestGateway {
public HttpStatus postMultipartRequest(Map<String, Object> multipartRequest); HttpStatus postMultipartRequest(Map<String, Object> multipartRequest);
} }

View File

@@ -5,10 +5,14 @@
<modelVersion>4.0.0</modelVersion> <modelVersion>4.0.0</modelVersion>
<groupId>org.springframework.integration.samples</groupId> <groupId>org.springframework.integration.samples</groupId>
<artifactId>intermediate-samples</artifactId> <artifactId>intermediate-samples</artifactId>
<version>2.1.0.BUILD-SNAPSHOT</version> <version>2.2.0.BUILD-SNAPSHOT</version>
<name>Spring Integration Samples - Intermediate</name> <name>Spring Integration Samples - Intermediate</name>
<packaging>pom</packaging> <packaging>pom</packaging>
<prerequisites>
<maven>2.2.1</maven>
</prerequisites>
<modules> <modules>
<module>async-gateway</module> <module>async-gateway</module>
<module>errorhandling</module> <module>errorhandling</module>

View File

@@ -1,15 +1,21 @@
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
<modelVersion>4.0.0</modelVersion> xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<groupId>org.springframework.integration.samples</groupId> <modelVersion>4.0.0</modelVersion>
<artifactId>rest-http</artifactId> <groupId>org.springframework.integration.samples</groupId>
<version>2.1.0.BUILD-SNAPSHOT</version> <artifactId>rest-http</artifactId>
<packaging>war</packaging> <version>2.2.0.BUILD-SNAPSHOT</version>
<name>Spring Integration Rest HTTP Path Usage Demo</name> <packaging>war</packaging>
<description>Spring Integration Rest HTTP Path Usage Demo</description> <name>Spring Integration Rest HTTP Path Usage Demo</name>
<properties> <description>Spring Integration Rest HTTP Path Usage Demo</description>
<spring.integration.version>2.1.0.RELEASE</spring.integration.version>
<spring.version>3.1.0.RELEASE</spring.version> <prerequisites>
<spring.security.version>3.1.0.RELEASE</spring.security.version> <maven>2.2.1</maven>
</prerequisites>
<properties>
<spring.integration.version>2.2.0.RC3</spring.integration.version>
<spring.version>3.1.3.RELEASE</spring.version>
<spring.security.version>3.1.3.RELEASE</spring.security.version>
<commons-fileupload>1.2</commons-fileupload> <commons-fileupload>1.2</commons-fileupload>
<commons-io>1.3.2</commons-io> <commons-io>1.3.2</commons-io>
<log4j.version>1.2.16</log4j.version> <log4j.version>1.2.16</log4j.version>
@@ -17,116 +23,116 @@
<junit.version>4.8.1</junit.version> <junit.version>4.8.1</junit.version>
<jasypt.version>1.7</jasypt.version> <jasypt.version>1.7</jasypt.version>
<cglib.version>2.2</cglib.version> <cglib.version>2.2</cglib.version>
</properties> </properties>
<dependencies> <dependencies>
<dependency> <dependency>
<groupId>org.springframework.integration</groupId> <groupId>org.springframework.integration</groupId>
<artifactId>spring-integration-http</artifactId> <artifactId>spring-integration-http</artifactId>
<version>${spring.integration.version}</version> <version>${spring.integration.version}</version>
</dependency> </dependency>
<dependency> <dependency>
<groupId>org.codehaus.jackson</groupId> <groupId>org.codehaus.jackson</groupId>
<artifactId>jackson-mapper-asl</artifactId> <artifactId>jackson-mapper-asl</artifactId>
<version>1.8.0</version> <version>1.8.0</version>
<scope>compile</scope> <scope>compile</scope>
</dependency> </dependency>
<dependency> <dependency>
<groupId>org.springframework.integration</groupId> <groupId>org.springframework.integration</groupId>
<artifactId>spring-integration-core</artifactId> <artifactId>spring-integration-core</artifactId>
<version>${spring.integration.version}</version> <version>${spring.integration.version}</version>
</dependency> </dependency>
<dependency> <dependency>
<groupId>org.springframework</groupId> <groupId>org.springframework</groupId>
<artifactId>spring-webmvc</artifactId> <artifactId>spring-webmvc</artifactId>
<version>${spring.version}</version> <version>${spring.version}</version>
</dependency> </dependency>
<dependency> <dependency>
<groupId>org.springframework</groupId> <groupId>org.springframework</groupId>
<artifactId>spring-oxm</artifactId> <artifactId>spring-oxm</artifactId>
<version>${spring.version}</version> <version>${spring.version}</version>
</dependency> </dependency>
<dependency> <dependency>
<groupId>org.springframework</groupId> <groupId>org.springframework</groupId>
<artifactId>spring-tx</artifactId> <artifactId>spring-tx</artifactId>
<version>${spring.version}</version> <version>${spring.version}</version>
</dependency> </dependency>
<dependency> <dependency>
<groupId>org.springframework</groupId> <groupId>org.springframework</groupId>
<artifactId>spring-jdbc</artifactId> <artifactId>spring-jdbc</artifactId>
<version>${spring.version}</version> <version>${spring.version}</version>
</dependency> </dependency>
<dependency> <dependency>
<groupId>org.springframework</groupId> <groupId>org.springframework</groupId>
<artifactId>spring-context</artifactId> <artifactId>spring-context</artifactId>
<version>${spring.version}</version> <version>${spring.version}</version>
</dependency> </dependency>
<dependency> <dependency>
<groupId>org.springframework</groupId> <groupId>org.springframework</groupId>
<artifactId>spring-aop</artifactId> <artifactId>spring-aop</artifactId>
<version>${spring.version}</version> <version>${spring.version}</version>
</dependency> </dependency>
<dependency> <dependency>
<groupId>org.springframework.security</groupId> <groupId>org.springframework.security</groupId>
<artifactId>spring-security-core</artifactId> <artifactId>spring-security-core</artifactId>
<scope>compile</scope> <scope>compile</scope>
<version>${spring.security.version}</version> <version>${spring.security.version}</version>
</dependency> </dependency>
<dependency> <dependency>
<groupId>org.springframework.security</groupId> <groupId>org.springframework.security</groupId>
<artifactId>spring-security-config</artifactId> <artifactId>spring-security-config</artifactId>
<scope>compile</scope> <scope>compile</scope>
<version>${spring.security.version}</version> <version>${spring.security.version}</version>
</dependency> </dependency>
<dependency> <dependency>
<groupId>org.springframework.security</groupId> <groupId>org.springframework.security</groupId>
<artifactId>spring-security-web</artifactId> <artifactId>spring-security-web</artifactId>
<scope>compile</scope> <scope>compile</scope>
<version>${spring.security.version}</version> <version>${spring.security.version}</version>
</dependency> </dependency>
<dependency> <dependency>
<groupId>log4j</groupId> <groupId>log4j</groupId>
<artifactId>log4j</artifactId> <artifactId>log4j</artifactId>
<version>${log4j.version}</version> <version>${log4j.version}</version>
</dependency> </dependency>
<dependency> <dependency>
<groupId>org.jasypt</groupId> <groupId>org.jasypt</groupId>
<artifactId>jasypt</artifactId> <artifactId>jasypt</artifactId>
<version>${jasypt.version}</version> <version>${jasypt.version}</version>
<scope>runtime</scope> <scope>runtime</scope>
</dependency> </dependency>
<dependency> <dependency>
<groupId>cglib</groupId> <groupId>cglib</groupId>
<artifactId>cglib</artifactId> <artifactId>cglib</artifactId>
<version>${cglib.version}</version> <version>${cglib.version}</version>
<scope>runtime</scope> <scope>runtime</scope>
</dependency> </dependency>
<!-- Servlet dependency --> <!-- Servlet dependency -->
<dependency> <dependency>
<groupId>javax.servlet</groupId> <groupId>javax.servlet</groupId>
<artifactId>servlet-api</artifactId> <artifactId>servlet-api</artifactId>
<version>${javax.servlet.version}</version> <version>${javax.servlet.version}</version>
<scope>provided</scope> <scope>provided</scope>
</dependency> </dependency>
<dependency> <dependency>
<groupId>org.springframework</groupId> <groupId>org.springframework</groupId>
<artifactId>spring-test</artifactId> <artifactId>spring-test</artifactId>
<version>${spring.version}</version> <version>${spring.version}</version>
<scope>test</scope> <scope>test</scope>
<exclusions> <exclusions>
<exclusion> <exclusion>
<groupId>org.springframework</groupId> <groupId>org.springframework</groupId>
<artifactId>spring-tx</artifactId> <artifactId>spring-tx</artifactId>
</exclusion> </exclusion>
</exclusions> </exclusions>
</dependency> </dependency>
<dependency> <dependency>
<groupId>junit</groupId> <groupId>junit</groupId>
<artifactId>junit</artifactId> <artifactId>junit</artifactId>
<version>${junit.version}</version> <version>${junit.version}</version>
<scope>test</scope> <scope>test</scope>
</dependency> </dependency>
</dependencies> </dependencies>
<build> <build>
<plugins> <plugins>
<plugin> <plugin>
<groupId>org.apache.maven.plugins</groupId> <groupId>org.apache.maven.plugins</groupId>
@@ -136,35 +142,38 @@
<target>1.6</target> <target>1.6</target>
<compilerArgument>-Xlint:all</compilerArgument> <compilerArgument>-Xlint:all</compilerArgument>
<showWarnings>true</showWarnings> <showWarnings>true</showWarnings>
<showDeprecation>false</showDeprecation> <showDeprecation>true</showDeprecation>
</configuration> </configuration>
</plugin> </plugin>
<plugin> <plugin>
<groupId>org.apache.maven.plugins</groupId> <groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-antrun-plugin</artifactId> <artifactId>maven-antrun-plugin</artifactId>
<version>1.6</version> <version>1.6</version>
<executions> <executions>
<execution> <execution>
<id>clean</id> <id>clean</id>
<configuration> <configuration>
<target> <target>
<echo>Copying jaxb.index to classes folder</echo> <echo>Copying jaxb.index to classes folder</echo>
</target> </target>
<target> <target>
<copy todir="${project.basedir}/target/classes/org/springframework/integration/samples/rest/domain" overwrite="true"> <copy
<fileset dir="${project.basedir}/src/main/java/org/springframework/integration/samples/rest/domain"> todir="${project.basedir}/target/classes/org/springframework/integration/samples/rest/domain"
<include name="**/jaxb.index"/> overwrite="true">
<fileset
dir="${project.basedir}/src/main/java/org/springframework/integration/samples/rest/domain">
<include name="**/jaxb.index" />
</fileset> </fileset>
</copy> </copy>
</target> </target>
</configuration> </configuration>
<phase>clean</phase> <phase>clean</phase>
<goals> <goals>
<goal>run</goal> <goal>run</goal>
</goals> </goals>
</execution> </execution>
</executions> </executions>
</plugin> </plugin>
</plugins> </plugins>
</build> </build>
<repositories> <repositories>
@@ -174,4 +183,4 @@
<url>https://repo.springsource.org/libs-milestone</url> <url>https://repo.springsource.org/libs-milestone</url>
</repository> </repository>
</repositories> </repositories>
</project> </project>

View File

@@ -4,14 +4,19 @@
<modelVersion>4.0.0</modelVersion> <modelVersion>4.0.0</modelVersion>
<groupId>org.springframework.integration.samples</groupId> <groupId>org.springframework.integration.samples</groupId>
<artifactId>retry-and-more</artifactId> <artifactId>retry-and-more</artifactId>
<version>2.1.0.BUILD-SNAPSHOT</version> <version>2.2.0.BUILD-SNAPSHOT</version>
<name>Samples (Intermediate) - Retry and More</name> <name>Samples (Intermediate) - Retry and More</name>
<packaging>jar</packaging> <packaging>jar</packaging>
<prerequisites>
<maven>2.2.1</maven>
</prerequisites>
<properties> <properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<spring.framework.version>3.1.2.RELEASE</spring.framework.version> <spring.framework.version>3.1.3.RELEASE</spring.framework.version>
<spring.integration.version>2.2.0.RC1</spring.integration.version> <spring.integration.version>2.2.0.RC3</spring.integration.version>
<log4j.version>1.2.16</log4j.version> <log4j.version>1.2.17</log4j.version>
<junit.version>4.10</junit.version> <junit.version>4.10</junit.version>
</properties> </properties>
@@ -41,11 +46,11 @@
<artifactId>log4j</artifactId> <artifactId>log4j</artifactId>
<version>${log4j.version}</version> <version>${log4j.version}</version>
</dependency> </dependency>
<dependency> <dependency>
<groupId>org.mockito</groupId> <groupId>org.mockito</groupId>
<artifactId>mockito-all</artifactId> <artifactId>mockito-all</artifactId>
<version>1.8.5</version> <version>1.8.5</version>
</dependency> </dependency>
<!-- test-scoped dependencies --> <!-- test-scoped dependencies -->
<dependency> <dependency>
<groupId>org.springframework</groupId> <groupId>org.springframework</groupId>
@@ -63,30 +68,30 @@
<plugin> <plugin>
<groupId>org.apache.maven.plugins</groupId> <groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId> <artifactId>maven-compiler-plugin</artifactId>
<version>2.3.2</version> <version>2.5.1</version>
<configuration> <configuration>
<source>1.5</source> <source>1.5</source>
<target>1.5</target> <target>1.5</target>
<compilerArgument>-Xlint:all</compilerArgument> <compilerArgument>-Xlint:all</compilerArgument>
<showWarnings>true</showWarnings> <showWarnings>true</showWarnings>
<showDeprecation>false</showDeprecation> <showDeprecation>true</showDeprecation>
</configuration>
</plugin>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>exec-maven-plugin</artifactId>
<version>1.2</version>
<configuration>
<mainClass>${java.main.class}</mainClass>
</configuration> </configuration>
</plugin> </plugin>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>exec-maven-plugin</artifactId>
<version>1.2</version>
<configuration>
<mainClass>${java.main.class}</mainClass>
</configuration>
</plugin>
</plugins> </plugins>
</build> </build>
<repositories> <repositories>
<repository> <repository>
<id>repo.springsource.org.milestone</id> <id>repo.springsource.org.milestone</id>
<name>Spring Framework Maven Milestone Repository</name> <name>Spring Framework Maven Milestone Repository</name>
<url>https://repo.springsource.org/libs-milestone</url> <url>https://repo.springsource.org/libs-milestone</url>
</repository> </repository>
</repositories> </repositories>
</project> </project>

View File

@@ -4,16 +4,20 @@
<groupId>org.springframework.integration.samples</groupId> <groupId>org.springframework.integration.samples</groupId>
<artifactId>derby-stored-procedures</artifactId> <artifactId>derby-stored-procedures</artifactId>
<version>2.1.0.BUILD-SNAPSHOT</version> <version>2.2.0.BUILD-SNAPSHOT</version>
<packaging>jar</packaging> <packaging>jar</packaging>
<name>Samples (Intermediate) - Stored Procedures Derby</name> <name>Samples (Intermediate) - Stored Procedures Derby</name>
<url>http://www.springsource.org/spring-integration</url> <url>http://www.springsource.org/spring-integration</url>
<prerequisites>
<maven>2.2.1</maven>
</prerequisites>
<properties> <properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<spring.integration.version>2.1.0.RELEASE</spring.integration.version> <spring.integration.version>2.2.0.RC3</spring.integration.version>
<log4j.version>1.2.16</log4j.version> <log4j.version>1.2.17</log4j.version>
<junit.version>4.10</junit.version> <junit.version>4.10</junit.version>
</properties> </properties>
@@ -29,7 +33,7 @@
<plugins> <plugins>
<plugin> <plugin>
<artifactId>maven-eclipse-plugin</artifactId> <artifactId>maven-eclipse-plugin</artifactId>
<version>2.8</version> <version>2.9</version>
<configuration> <configuration>
<additionalProjectnatures> <additionalProjectnatures>
<projectnature>org.springframework.ide.eclipse.core.springnature</projectnature> <projectnature>org.springframework.ide.eclipse.core.springnature</projectnature>
@@ -44,7 +48,7 @@
<plugin> <plugin>
<groupId>org.apache.maven.plugins</groupId> <groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId> <artifactId>maven-compiler-plugin</artifactId>
<version>2.3.2</version> <version>2.5.1</version>
<configuration> <configuration>
<source>1.6</source> <source>1.6</source>
<target>1.6</target> <target>1.6</target>
@@ -56,7 +60,7 @@
<plugin> <plugin>
<groupId>org.codehaus.mojo</groupId> <groupId>org.codehaus.mojo</groupId>
<artifactId>exec-maven-plugin</artifactId> <artifactId>exec-maven-plugin</artifactId>
<version>1.2</version> <version>1.2.1</version>
<configuration> <configuration>
<mainClass>org.springframework.integration.Main</mainClass> <mainClass>org.springframework.integration.Main</mainClass>
</configuration> </configuration>
@@ -100,7 +104,7 @@
<dependency> <dependency>
<groupId>org.apache.derby</groupId> <groupId>org.apache.derby</groupId>
<artifactId>derby</artifactId> <artifactId>derby</artifactId>
<version>10.8.2.2</version> <version>10.9.1.0</version>
</dependency> </dependency>
</dependencies> </dependencies>

View File

@@ -17,7 +17,7 @@
<properties> <properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<spring.integration.version>2.2.0.RC2</spring.integration.version> <spring.integration.version>2.2.0.RC3</spring.integration.version>
<log4j.version>1.2.17</log4j.version> <log4j.version>1.2.17</log4j.version>
<junit.version>4.10</junit.version> <junit.version>4.10</junit.version>
</properties> </properties>

View File

@@ -4,16 +4,20 @@
<groupId>org.springframework.integration.samples</groupId> <groupId>org.springframework.integration.samples</groupId>
<artifactId>oracle-stored-procedures</artifactId> <artifactId>oracle-stored-procedures</artifactId>
<version>2.1.0.BUILD-SNAPSHOT</version> <version>2.2.0.BUILD-SNAPSHOT</version>
<packaging>jar</packaging> <packaging>jar</packaging>
<name>Samples (Intermediate) - Stored Procedures Oracle</name> <name>Samples (Intermediate) - Stored Procedures Oracle</name>
<url>http://www.springsource.org/spring-integration</url> <url>http://www.springsource.org/spring-integration</url>
<prerequisites>
<maven>2.2.1</maven>
</prerequisites>
<properties> <properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<spring.integration.version>2.1.0.RELEASE</spring.integration.version> <spring.integration.version>2.2.0.RC3</spring.integration.version>
<log4j.version>1.2.16</log4j.version> <log4j.version>1.2.17</log4j.version>
<junit.version>4.10</junit.version> <junit.version>4.10</junit.version>
</properties> </properties>
@@ -44,7 +48,7 @@
<plugin> <plugin>
<groupId>org.apache.maven.plugins</groupId> <groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId> <artifactId>maven-compiler-plugin</artifactId>
<version>2.3.2</version> <version>2.5.1</version>
<configuration> <configuration>
<source>1.6</source> <source>1.6</source>
<target>1.6</target> <target>1.6</target>

View File

@@ -16,7 +16,7 @@
<properties> <properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<spring.integration.version>2.2.0.RC2</spring.integration.version> <spring.integration.version>2.2.0.RC3</spring.integration.version>
<log4j.version>1.2.17</log4j.version> <log4j.version>1.2.17</log4j.version>
<junit.version>4.10</junit.version> <junit.version>4.10</junit.version>
</properties> </properties>

View File

@@ -33,7 +33,7 @@ import org.springframework.integration.service.CoffeeService;
* @since 2.2 * @since 2.2
* *
*/ */
public final class Main { public class Main {
private static final Logger LOGGER = Logger.getLogger(Main.class); private static final Logger LOGGER = Logger.getLogger(Main.class);

View File

@@ -7,7 +7,7 @@
xmlns:tx="http://www.springframework.org/schema/tx" xmlns:tx="http://www.springframework.org/schema/tx"
xsi:schemaLocation="http://www.springframework.org/schema/jdbc http://www.springframework.org/schema/jdbc/spring-jdbc.xsd xsi:schemaLocation="http://www.springframework.org/schema/jdbc http://www.springframework.org/schema/jdbc/spring-jdbc.xsd
http://www.springframework.org/schema/integration http://www.springframework.org/schema/integration/spring-integration.xsd http://www.springframework.org/schema/integration http://www.springframework.org/schema/integration/spring-integration.xsd
http://www.springframework.org/schema/integration/jdbc http://www.springframework.org/schema/integration/jdbc/spring-integration-jdbc.xsd http://www.springframework.org/schema/integration/jdbc file:///Users/hillert/dev/git/spring-integration/spring-integration-jdbc/src/main/resources/org/springframework/integration/jdbc/config/spring-integration-jdbc-2.2.xsd
http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx.xsd"> http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx.xsd">
@@ -49,7 +49,16 @@
row-mapper="org.springframework.integration.support.CoffeBeverageMapper" /> row-mapper="org.springframework.integration.support.CoffeBeverageMapper" />
</int-jdbc:stored-proc-outbound-gateway> </int-jdbc:stored-proc-outbound-gateway>
<int-jdbc:stored-proc-inbound-channel-adapter data-source="dataSource" ignore-column-meta-data="true"
channel="loggit" expect-single-result="true" stored-procedure-name="FIND_ALL_COFFEE_BEVERAGES">
<int-jdbc:returning-resultset name="ref" row-mapper="org.springframework.integration.support.CoffeBeverageMapper"/>
</int-jdbc:stored-proc-inbound-channel-adapter>
<int:logging-channel-adapter id="loggit" log-full-message="true"/>
<bean id="transactionManager" class="org.springframework.jdbc.datasource.DataSourceTransactionManager"> <bean id="transactionManager" class="org.springframework.jdbc.datasource.DataSourceTransactionManager">
<property name="dataSource" ref="dataSource"/> <property name="dataSource" ref="dataSource"/>
</bean> </bean>
<int:poller default="true" fixed-rate="5000"><int:transactional/></int:poller>
</beans> </beans>

View File

@@ -4,14 +4,19 @@
<modelVersion>4.0.0</modelVersion> <modelVersion>4.0.0</modelVersion>
<groupId>org.springframework.integration.samples</groupId> <groupId>org.springframework.integration.samples</groupId>
<artifactId>tcp-client-server-multiplex</artifactId> <artifactId>tcp-client-server-multiplex</artifactId>
<version>2.1.0.BUILD-SNAPSHOT</version> <version>2.2.0.BUILD-SNAPSHOT</version>
<name>Samples (Intermediate) - TCP Client Server Multiplexing Sample</name> <name>Samples (Intermediate) - TCP Client Server Multiplexing Sample</name>
<packaging>jar</packaging> <packaging>jar</packaging>
<prerequisites>
<maven>2.2.1</maven>
</prerequisites>
<properties> <properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<spring.version>3.1.0.RELEASE</spring.version> <spring.version>3.1.3.RELEASE</spring.version>
<spring.integration.version>2.1.0.RELEASE</spring.integration.version> <spring.integration.version>2.2.0.RC3</spring.integration.version>
<log4j.version>1.2.16</log4j.version> <log4j.version>1.2.17</log4j.version>
<junit.version>4.10</junit.version> <junit.version>4.10</junit.version>
</properties> </properties>
<dependencies> <dependencies>
@@ -48,13 +53,13 @@
<plugin> <plugin>
<groupId>org.apache.maven.plugins</groupId> <groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId> <artifactId>maven-compiler-plugin</artifactId>
<version>2.3.2</version> <version>2.5.1</version>
<configuration> <configuration>
<source>1.5</source> <source>1.6</source>
<target>1.5</target> <target>1.6</target>
<compilerArgument>-Xlint:all</compilerArgument> <compilerArgument>-Xlint:all</compilerArgument>
<showWarnings>true</showWarnings> <showWarnings>true</showWarnings>
<showDeprecation>false</showDeprecation> <showDeprecation>true</showDeprecation>
</configuration> </configuration>
</plugin> </plugin>
</plugins> </plugins>

View File

@@ -1,5 +1,5 @@
/* /*
* Copyright 2002-2010 the original author or authors. * Copyright 2002-2012 the original author or authors.
* *
* Licensed under the Apache License, Version 2.0 (the "License"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
@@ -17,11 +17,12 @@ package org.springframework.integration.samples.tcpclientserver;
/** /**
* @author Gary Russell * @author Gary Russell
* @author Gunnar Hillert
* @since 2.1 * @since 2.1
* *
*/ */
public interface SimpleGateway { public interface SimpleGateway {
public String send(String text); String send(String text);
} }

View File

@@ -4,13 +4,18 @@
<groupId>org.springframework.integration.samples</groupId> <groupId>org.springframework.integration.samples</groupId>
<artifactId>travel</artifactId> <artifactId>travel</artifactId>
<name>Samples (Intermediate) - Travel Services</name> <name>Samples (Intermediate) - Travel Services</name>
<version>2.1.0.BUILD-SNAPSHOT</version> <version>2.2.0.BUILD-SNAPSHOT</version>
<prerequisites>
<maven>2.2.1</maven>
</prerequisites>
<properties> <properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<spring.integration.version>2.2.0.RC2</spring.integration.version> <spring.integration.version>2.2.0.RC3</spring.integration.version>
<log4j.version>1.2.17</log4j.version> <log4j.version>1.2.17</log4j.version>
<junit.version>4.10</junit.version> <junit.version>4.10</junit.version>
<spring.version>3.1.2.RELEASE</spring.version> <spring.version>3.1.3.RELEASE</spring.version>
<java.main.class>org.springframework.integration.samples.travel.Main</java.main.class> <java.main.class>org.springframework.integration.samples.travel.Main</java.main.class>
</properties> </properties>
<dependencies> <dependencies>
@@ -58,7 +63,7 @@
<plugin> <plugin>
<groupId>org.apache.maven.plugins</groupId> <groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId> <artifactId>maven-compiler-plugin</artifactId>
<version>2.3.2</version> <version>2.5.1</version>
<configuration> <configuration>
<source>1.6</source> <source>1.6</source>
<target>1.6</target> <target>1.6</target>

View File

@@ -25,8 +25,8 @@ package org.springframework.integration.samples.travel;
*/ */
public interface TravelGateway { public interface TravelGateway {
public String getWeatherByCity(City city); String getWeatherByCity(City city);
public String getTrafficByCity(City city); String getTrafficByCity(City city);
} }

View File

@@ -4,14 +4,19 @@
<modelVersion>4.0.0</modelVersion> <modelVersion>4.0.0</modelVersion>
<groupId>org.springframework.integration.samples</groupId> <groupId>org.springframework.integration.samples</groupId>
<artifactId>tx-synch</artifactId> <artifactId>tx-synch</artifactId>
<version>2.1.0.BUILD-SNAPSHOT</version> <version>2.2.0.BUILD-SNAPSHOT</version>
<name>Samples (Intermediate) - Transaction Synchronization</name> <name>Samples (Intermediate) - Transaction Synchronization</name>
<packaging>jar</packaging> <packaging>jar</packaging>
<prerequisites>
<maven>2.2.1</maven>
</prerequisites>
<properties> <properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<spring.framework.version>3.1.2.RELEASE</spring.framework.version> <spring.framework.version>3.1.3.RELEASE</spring.framework.version>
<spring.integration.version>2.2.0.RC1</spring.integration.version> <spring.integration.version>2.2.0.RC3</spring.integration.version>
<log4j.version>1.2.16</log4j.version> <log4j.version>1.2.17</log4j.version>
<junit.version>4.10</junit.version> <junit.version>4.10</junit.version>
</properties> </properties>
@@ -42,20 +47,20 @@
<version>${spring.framework.version}</version> <version>${spring.framework.version}</version>
</dependency> </dependency>
<dependency> <dependency>
<groupId>com.h2database</groupId> <groupId>com.h2database</groupId>
<artifactId>h2</artifactId> <artifactId>h2</artifactId>
<version>1.3.166</version> <version>1.3.166</version>
</dependency> </dependency>
<dependency> <dependency>
<groupId>log4j</groupId> <groupId>log4j</groupId>
<artifactId>log4j</artifactId> <artifactId>log4j</artifactId>
<version>${log4j.version}</version> <version>${log4j.version}</version>
</dependency> </dependency>
<dependency> <dependency>
<groupId>org.mockito</groupId> <groupId>org.mockito</groupId>
<artifactId>mockito-all</artifactId> <artifactId>mockito-all</artifactId>
<version>1.8.5</version> <version>1.8.5</version>
</dependency> </dependency>
<!-- test-scoped dependencies --> <!-- test-scoped dependencies -->
<dependency> <dependency>
<groupId>org.springframework</groupId> <groupId>org.springframework</groupId>
@@ -73,30 +78,30 @@
<plugin> <plugin>
<groupId>org.apache.maven.plugins</groupId> <groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId> <artifactId>maven-compiler-plugin</artifactId>
<version>2.3.2</version> <version>2.5.1</version>
<configuration> <configuration>
<source>1.5</source> <source>1.6</source>
<target>1.5</target> <target>1.6</target>
<compilerArgument>-Xlint:all</compilerArgument> <compilerArgument>-Xlint:all</compilerArgument>
<showWarnings>true</showWarnings> <showWarnings>true</showWarnings>
<showDeprecation>false</showDeprecation> <showDeprecation>true</showDeprecation>
</configuration>
</plugin>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>exec-maven-plugin</artifactId>
<version>1.2</version>
<configuration>
<mainClass>${java.main.class}</mainClass>
</configuration> </configuration>
</plugin> </plugin>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>exec-maven-plugin</artifactId>
<version>1.2</version>
<configuration>
<mainClass>${java.main.class}</mainClass>
</configuration>
</plugin>
</plugins> </plugins>
</build> </build>
<repositories> <repositories>
<repository> <repository>
<id>repo.springsource.org.milestone</id> <id>repo.springsource.org.milestone</id>
<name>Spring Framework Maven Milestone Repository</name> <name>Spring Framework Maven Milestone Repository</name>
<url>https://repo.springsource.org/libs-snapshot</url> <url>https://repo.springsource.org/libs-snapshot</url>
</repository> </repository>
</repositories> </repositories>
</project> </project>

View File

@@ -10,6 +10,10 @@
<url>http://www.springsource.org/spring-integration</url> <url>http://www.springsource.org/spring-integration</url>
<packaging>pom</packaging> <packaging>pom</packaging>
<prerequisites>
<maven>2.2.1</maven>
</prerequisites>
<modules> <modules>
<module>basic</module> <module>basic</module>
<module>intermediate</module> <module>intermediate</module>