Spring Integration Reference Manual

Mark Fisher

Marius Bogoevici

Iwein Fuld

Jonas Partner

Oleg Zhurakousky

Gary Russell

Dave Syer

Josh Long

David Turanski

2.0.4.RELEASE

© SpringSource Inc., 2011


Table of Contents

I. What's new in Spring Integration 2.0
1. What's new in Spring Integration 2.0?
1.1. Spring 3 support
1.1.1. Support for the Spring Expression Language (SpEL)
1.1.2. ConversionService and Converter
1.1.3. TaskScheduler and Trigger
1.1.4. RestTemplate and HttpMessageConverter
1.2. Enterprise Integration Pattern Additions
1.2.1. Message History
1.2.2. Message Store
1.2.3. Claim Check
1.2.4. Control Bus
1.3. New Channel Adapters and Gateways
1.3.1. TCP/UDP Adapters
1.3.2. Twitter Adapters
1.3.3. XMPP Adapters
1.3.4. FTP/FTPS Adapters
1.3.5. SFTP Adapters
1.3.6. Feed Adapters
1.4. Other Additions
1.4.1. Groovy Support
1.4.2. Map Transformers
1.4.3. JSON Transformers
1.4.4. Serialization Transformers
1.5. Framework Refactoring
1.6. New Source Control Management and Build Infrastructure
1.7. New Spring Integration Samples
1.8. SpringSource Tool Suite Visual Editor for Spring Integration
1.9. Upcoming Spring Integration ROO support
II. Overview of Spring Integration Framework
2. Spring Integration Overview
2.1. Background
2.2. Goals and Principles
2.3. Main Components
2.3.1. Message
2.3.2. Message Channel
2.3.3. Message Endpoint
2.4. Message Endpoints
2.4.1. Transformer
2.4.2. Filter
2.4.3. Router
2.4.4. Splitter
2.4.5. Aggregator
2.4.6. Service Activator
2.4.7. Channel Adapter
III. Core Messaging
3. Messaging Channels
3.1. Message Channels
3.1.1. The MessageChannel Interface
PollableChannel
SubscribableChannel
3.1.2. Message Channel Implementations
PublishSubscribeChannel
QueueChannel
PriorityChannel
RendezvousChannel
DirectChannel
ExecutorChannel
Scoped Channel
3.1.3. Channel Interceptors
3.1.4. MessagingTemplate
3.1.5. Configuring Message Channels
DirectChannel Configuration
QueueChannel Configuration
PublishSubscribeChannel Configuration
ExecutorChannel
PriorityChannel Configuration
RendezvousChannel Configuration
Scoped Channel Configuration
Channel Interceptor Configuration
Global Channel Interceptor
Wire Tap
Global Wire Tap Configuration
3.1.6. Special Channels
3.2. Channel Adapter
3.2.1. Configuring Inbound Channel Adapter
3.2.2. Configuring Outbound Channel Adapter
3.3. Messaging Bridge
3.3.1. Introduction
3.3.2. Configuring Bridge
4. Message Construction
4.1. Message
4.1.1. The Message Interface
4.1.2. Message Headers
4.1.3. Message Implementations
4.1.4. The MessageBuilder Helper Class
5. Message Routing
5.1. Router
5.1.1. Router Implementations
PayloadTypeRouter
HeaderValueRouter
RecipientListRouter
5.1.2. Routing and Error handling
5.1.3. Configuring Router
Configuring a Content Based Router with XML
Configuring a Router with Annotations
5.1.4. Dynamic Routers
5.2. Filter
5.2.1. Introduction
5.2.2. Configuring Filter
5.3. Splitter
5.3.1. Introduction
5.3.2. Programming model
5.3.3. Configuring Splitter
Configuring a Splitter using XML
Configuring a Splitter with Annotations
5.4. Aggregator
5.4.1. Introduction
5.4.2. Functionality
5.4.3. Programming model
CorrelatingMessageHandler
ReleaseStrategy
CorrelationStrategy
5.4.4. Configuring Aggregator
Configuring an Aggregator with XML
Configuring an Aggregator with Annotations
5.4.5. Managing State in an Aggregator: MessageGroupStore
5.5. Resequencer
5.5.1. Introduction
5.5.2. Functionality
5.5.3. Configuring a Resequencer
5.6. Message Handler Chain
5.6.1. Introduction
5.6.2. Configuring Chain
6. Message Transformation
6.1. Transformer
6.1.1. Introduction
6.1.2. Configuring Transformer
Configuring Transformer with XML
Configuring a Transformer with Annotations
6.1.3. Header Filter
6.2. Content Enricher
6.2.1. Introduction
6.2.2. Header Enricher
6.3. Claim Check
6.3.1. Introduction
Incoming Claim Check Transformer
Outgoing Claim Check Transformer
7. Messaging Endpoints
7.1. Message Endpoints
7.1.1. Message Handler
7.1.2. Event Driven Consumer
7.1.3. Polling Consumer
7.1.4. Namespace Support
7.1.5. Payload Type Conversion
7.1.6. Asynchronous polling
7.2. Inbound Messaging Gateways
7.2.1. GatewayProxyFactoryBean
7.2.2. Asynchronous Gateway
7.2.3. Gateway behavior when no response arrives
7.3. Service Activator
7.3.1. Introduction
7.3.2. Configuring Service Activator
7.4. Delayer
7.4.1. Introduction
7.4.2. Configuring Delayer
7.5. Groovy support
7.5.1. Groovy configuration
7.5.2. Control Bus
8. System Management
8.1. JMX Support
8.1.1. Notification Listening Channel Adapter
8.1.2. Notification Publishing Channel Adapter
8.1.3. Attribute Polling Channel Adapter
8.1.4. Operation Invoking Channel Adapter
8.1.5. Operation Invoking outbound Gateway
8.1.6. MBean Exporter
MBean ObjectNames
MessageChannel MBean Features
8.2. Message History
8.2.1. Message History Configuration
8.3. Control Bus
IV. Integration Adapters
9. Spring ApplicationEvent Support
9.1. Receiving Spring ApplicationEvents
9.2. Sending Spring ApplicationEvents
10. Feed Adapter
10.1. Introduction
10.2. Feed Inbound Channel Adapter
11. File Support
11.1. Introduction
11.2. Reading Files
11.3. Writing files
11.4. File Transformers
12. FTP/FTPS Adapters
12.1. Introduction
12.2. FTP Session Factory
12.3. FTP Inbound Channel Adapter
12.4. FTP Outbound Channel Adapter
13. HTTP Support
13.1. Introduction
13.2. Http Inbound Gateway
13.3. Http Outbound Gateway
13.4. HTTP Namespace Support
13.5. HTTP Proxy configuration
13.6. HTTP Header Mappings
13.7. HTTP Samples
13.7.1. Multipart HTTP request - RestTemplate (client) and Http Inbound Gateway (server)
14. HttpInvoker Support
14.1. Introduction
14.2. HttpInvoker Inbound Gateway
14.3. HttpInvoker Outbound Gateway
14.4. HttpInvoker Namespace Support
15. Mail Support
15.1. Mail-Sending Channel Adapter
15.2. Mail-Receiving Channel Adapter
15.3. Mail Namespace Support
15.4. Email Message Filtering
16. TCP and UDP Support
16.1. Introduction
16.2. UDP Adapters
16.3. TCP Connection Factories
16.4. Tcp Connection Interceptors
16.5. TCP Adapters
16.6. TCP Gateways
16.7. TCP Message Correlation
16.7.1. Overview
16.7.2. Gateways
16.7.3. Collaborating Outbound and Inbound Channel Adapters
16.8. A Note About NIO
16.9. IP Configuration Attributes
17. JDBC Support
17.1. Inbound Channel Adapter
17.1.1. Polling and Transactions
17.2. Outbound Channel Adapter
17.3. Outbound Gateway
17.4. Message Store
17.4.1. Initializing the Database
17.4.2. Partitioning a Message Store
18. JMS Support
18.1. Inbound Channel Adapter
18.2. Message-Driven Channel Adapter
18.3. Outbound Channel Adapter
18.4. Inbound Gateway
18.5. Outbound Gateway
18.6. Mapping Message Headers to/from JMS Message
18.7. Message Conversion, Marshalling and Unmarshalling
18.8. JMS Backed Message Channels
18.9. JMS Samples
19. RMI Support
19.1. Introduction
19.2. Outbound RMI
19.3. Inbound RMI
19.4. RMI namespace support
20. SFTP Adapters
20.1. Introduction
20.2. SFTP Session Factory
20.3. SFTP Inbound Channel Adapter
20.4. SFTP Outbound Channel Adapter
20.5. SFTP/JSCH Logging
21. Stream Support
21.1. Introduction
21.2. Reading from streams
21.3. Writing to streams
21.4. Stream namespace support
22. Twitter Adapter
22.1. Introduction
22.2. Twitter OAuth Configuration
22.3. Twitter Template
22.4. Twitter Inbound Adapters
22.4.1. Inbound Message Channel Adapter
22.4.2. Direct Inbound Message Channel Adapter
22.4.3. Mentions Inbound Message Channel Adapter
22.4.4. Search Inbound Message Channel Adapter
22.5. Twitter Outbound Adapter
22.5.1. Twitter Outbound Update Channel Adapter
22.5.2. Twitter Outbound Direct Message Channel Adapter
23. Web Services Support
23.1. Outbound Web Service Gateways
23.2. Inbound Web Service Gateways
23.3. Web Service Namespace Support
24. XML Support - Dealing with XML Payloads
24.1. Introduction
24.2. Transforming xml payloads
24.3. Namespace support for xml transformers
24.4. Splitting xml messages
24.5. Routing xml messages using XPath
24.6. Selecting xml messages using XPath
24.7. Transforming xml messages using XPath
24.8. XPath components namespace support
25. XMPP Support
25.1. Introduction
25.2. XMPP Connection
25.3. XMPP Messages
25.3.1. Inbound Message Channel Adapter
25.3.2. Outbound Message Channel Adapter
25.4. XMPP Presence
25.4.1. Inbound Presence Message Channel Adapter
25.4.2. Outbound Presence Message Channel Adapter
25.5. Appendices
V. Appendices
26. Message Publishing
26.1. Message Publishing Configuration
26.1.1. Annotation-driven approach via @Publisher annotation
26.1.2. XML-based approach via the <publishing-interceptor> element
26.1.3. Producing and publishing messages based on a scheduled trigger
27. Transaction Support
27.1. Understanding Transactions in Message flows
27.1.1. Poller Transaction Support
27.2. Transaction Boundaries
28. Security in Spring Integration
28.1. Introduction
28.2. Securing channels
A. Spring Integration Samples
A.1. Introduction
A.2. Where to get Samples
A.3. Samples Structure
A.4. Samples
A.4.1. Loan Broker
A.4.2. The Cafe Sample
A.4.3. The XML Messaging Sample
B. Configuration
B.1. Introduction
B.2. Namespace Support
B.3. Configuring the Task Scheduler
B.4. Error Handling
B.5. Annotation Support
B.6. Message Mapping rules and conventions
B.6.1. Simple Scenarios
B.6.2. Complex Scenarios
C. Additional Resources
C.1. Spring Integration Home