Spring Integration Reference Manual

Authors

Mark Fisher, Marius Bogoevici, Iwein Fuld, Jonas Partner, Oleg Zhurakousky, Gary Russell, Dave Syer, Josh Long, David Turanski, Gunnar Hillert, Artem Bilan, Amol Nayak, Jay Bryant

5.1.2.RELEASE

Copies of this document may be made for your own use and for distribution to others, provided that you do not charge any fee for such copies and further provided that each copy contains this Copyright Notice, whether distributed in print or electronically.


Table of Contents

I. Preface
1. Requirements
1.1. Compatible Java Versions
1.2. Compatible Versions of the Spring Framework
2. Code Conventions
3. Conventions in This Guide
II. What’s New?
4. What’s New in Spring Integration 5.1?
4.1. New Components
4.1.1. AmqpDedicatedChannelAdvice
4.1.2. Improved Function Support
4.1.3. @LongRunningTest
4.2. General Changes
4.2.1. Java DSL
4.2.2. Dispatcher Exceptions
4.2.3. Global Channel Interceptors
4.2.4. Channel Interceptors
4.2.5. ObjectToJsonTransformer
4.2.6. Integration Flows: Generated Bean Names
4.2.7. Aggregator Changes
4.2.8. @Publisher annotation changes
4.3. Files Changes
4.4. AMQP Changes
4.5. JDBC Changes
4.6. FTP and SFTP Changes
4.7. TCP Support
4.8. Twitter Support
4.9. JMS Support
4.10. HTTP/WebFlux Support
4.11. JMX Changes
4.12. Micrometer Support Changes
4.13. Integration Graph Customization
4.14. Integration Global Properties
4.15. The receiveTimeout for @Poller
III. Overview of Spring Integration Framework
5. Spring Integration Overview
5.1. Background
5.2. Goals and Principles
5.3. Main Components
5.3.1. Message
5.3.2. Message Channel
5.3.3. Message Endpoint
5.4. Message Endpoints
5.4.1. Message Transformer
5.4.2. Message Filter
5.4.3. Message Router
5.4.4. Splitter
5.4.5. Aggregator
5.4.6. Service Activator
5.4.7. Channel Adapter
5.4.8. Endpoint Bean Names
5.5. Configuration and @EnableIntegration
5.6. Programming Considerations
5.6.1. Considerations When Using Packaged (for example, Shaded) Jars
5.7. Programming Tips and Tricks
5.7.1. XML Schemas
5.7.2. Finding Class Names for Java and DSL Configuration
5.8. POJO Method invocation
IV. Core Messaging
6. Messaging Channels
6.1. Message Channels
6.1.1. The MessageChannel Interface
PollableChannel
SubscribableChannel
6.1.2. Message Channel Implementations
PublishSubscribeChannel
QueueChannel
PriorityChannel
RendezvousChannel
DirectChannel
ExecutorChannel
Scoped Channel
6.1.3. Channel Interceptors
6.1.4. MessagingTemplate
6.1.5. Configuring Message Channels
DirectChannel Configuration
Datatype Channel Configuration
QueueChannel Configuration
PublishSubscribeChannel Configuration
ExecutorChannel
PriorityChannel Configuration
RendezvousChannel Configuration
Scoped Channel Configuration
Channel Interceptor Configuration
Global Channel Interceptor Configuration
Wire Tap
Conditional Wire Taps
Global Wire Tap Configuration
6.1.6. Special Channels
6.2. Poller
6.2.1. Polling Consumer
6.2.2. Pollable Message Source
6.2.3. Deferred Acknowledgment Pollable Message Source
6.2.4. Conditional Pollers for Message Sources
Background
"Smart" Polling
SimpleActiveIdleMessageSourceAdvice
CompoundTriggerAdvice
6.3. Channel Adapter
6.3.1. Configuring An Inbound Channel Adapter
6.3.2. Configuring An Outbound Channel Adapter
6.3.3. Channel Adapter Expressions and Scripts
6.4. Messaging Bridge
6.4.1. Configuring a Bridge with XML
6.4.2. Configuring a Bridge with Java Configuration
6.4.3. Configuring a Bridge with the Java DSL
7. Message
7.1. The Message Interface
7.2. Message Headers
7.2.1. MessageHeaderAccessor API
7.2.2. Message ID Generation
7.2.3. Read-only Headers
7.2.4. Header Propagation
7.3. Message Implementations
7.4. The MessageBuilder Helper Class
8. Message Routing
8.1. Routers
8.1.1. Overview
8.1.2. Common Router Parameters
Inside and Outside of a Chain
Top-Level (Outside of a Chain)
8.1.3. Router Implementations
PayloadTypeRouter
HeaderValueRouter
RecipientListRouter
RecipientListRouterManagement
XPath Router
Routing and Error Handling
8.1.4. Configuring a Generic Router
Configuring a Content-based Router with XML
8.1.5. Routers and the Spring Expression Language (SpEL)
Configuring a Router with Annotations
8.1.6. Dynamic Routers
Manage Router Mappings using the Control Bus
Manage Router Mappings by Using JMX
Routing Slip
Process Manager Enterprise Integration Pattern
8.2. Filter
8.2.1. Configuring a Filter with XML
8.2.2. Configuring a Filter with Annotations
8.3. Splitter
8.3.1. Programming Model
Iterators
Stream and Flux
8.3.2. Configuring a Splitter with XML
8.3.3. Configuring a Splitter with Annotations
8.4. Aggregator
8.4.1. Functionality
8.4.2. Programming Model
AggregatingMessageHandler
ReleaseStrategy
Aggregating Large Groups
Correlation Strategy
Lock Registry
Avoiding Deadlocks
8.4.3. Configuring an Aggregator in Java DSL
Configuring an Aggregator with XML
Configuring an Aggregator with Annotations
8.4.4. Managing State in an Aggregator: MessageGroupStore
8.5. Resequencer
8.5.1. Functionality
8.5.2. Configuring a Resequencer
8.6. Message Handler Chain
8.6.1. Configuring a Chain
8.6.2. Using the id Attribute
8.6.3. Calling a Chain from within a Chain
8.7. Scatter-Gather
8.7.1. Functionality
Auction
Distribution
8.7.2. Configuring a Scatter-Gather Endpoint
8.8. Thread Barrier
9. Message Transformation
9.1. Transformer
9.1.1. Configuring a Transformer with XML
9.1.2. Transformers and Spring Expression Language (SpEL)
9.1.3. Common Transformers
Object-to-String Transformer
Object-to-Map and Map-to-Object Transformers
Stream Transformer
JSON Transformers
9.1.4. Configuring a Transformer with Annotations
9.1.5. Header Filter
9.1.6. Codec-Based Transformers
9.2. Content Enricher
9.2.1. Header Enricher
POJO Support
SpEL Support
Configuring a Header Enricher with Java Configuration
Configuring a Header Enricher with the Java DSL
Header Channel Registry
9.2.2. Payload Enricher
Configuration
Examples
How Do I Pass Only a Subset of Data to the Request Channel?
How Can I Enrich Payloads with Static Information without Using a Request Channel?
9.3. Claim Check
9.3.1. Incoming Claim Check Transformer
9.3.2. Outgoing Claim Check Transformer
9.3.3. Claim Once
9.3.4. A Word on Message Store
9.4. Codec
9.4.1. EncodingPayloadTransformer
9.4.2. DecodingTransformer
9.4.3. CodecMessageConverter
9.4.4. Kryo
Customizing Kryo
10. Messaging Endpoints
10.1. Message Endpoints
10.1.1. Message Handler
10.1.2. Event-driven Consumer
10.1.3. Polling Consumer
10.1.4. Endpoint Namespace Support
Examples
AOP Advice chains
10.1.5. Changing Polling Rate at Runtime
10.1.6. Payload Type Conversion
10.1.7. Content Type Conversion
10.1.8. Asynchronous Polling
10.1.9. Endpoint Inner Beans
10.2. Endpoint Roles
10.3. Leadership Event Handling
10.4. Messaging Gateways
10.4.1. Enter the GatewayProxyFactoryBean
10.4.2. Gateway XML Namespace Support
10.4.3. Setting the Default Reply Channel
10.4.4. Gateway Configuration with Annotations and XML
Expressions and "Global" Headers
10.4.5. Mapping Method Arguments to a Message
Mapping Method Arguments
10.4.6. @MessagingGateway Annotation
10.4.7. Invoking No-Argument Methods
10.4.8. Error Handling
10.4.9. Gateway Timeouts
10.4.10. Asynchronous Gateway
ListenableFuture
AsyncTaskExecutor
CompletableFuture
Reactor Mono
Downstream Flows Returning an Asynchronous Type
void Return Type
10.4.11. Gateway Behavior When No response Arrives
Long-running Process Downstream
Downstream Component Returns null
Downstream Component Return Signature is void While Gateway Method Signature Is Non-void
Downstream Component Results in Runtime Exception
10.5. Service Activator
10.5.1. Configuring Service Activator
Service Activators and the Spring Expression Language (SpEL)
10.5.2. Asynchronous Service Activator
10.5.3. Service Activator and Method Return Type
10.6. Delayer
10.6.1. Configuring a Delayer
10.6.2. Delayer and a Message Store
10.6.3. Release Failures
10.7. Scripting Support
10.7.1. Script Configuration
Script Variable Bindings
10.8. Groovy support
10.8.1. Groovy Configuration
10.8.2. Groovy Object Customization
10.8.3. Groovy Script Compiler Customization
10.8.4. Control Bus
10.9. Adding Behavior to Endpoints
10.9.1. Provided Advice Classes
Retry Advice
Circuit Breaker Advice
Expression Evaluating Advice
10.9.2. Custom Advice Classes
10.9.3. Other Advice Chain Elements
10.9.4. Handling Message Advice
10.9.5. Transaction Support
10.9.6. Advising Filters
10.9.7. Advising Endpoints Using Annotations
10.9.8. Ordering Advices within an Advice Chain
10.9.9. Advised Handler Properties
10.9.10. Idempotent Receiver Enterprise Integration Pattern
10.10. Logging Channel Adapter
10.10.1. Using Java Configuration
10.10.2. Configuring with the Java DSL
10.11. java.util.function Interfaces Support
10.11.1. Kotlin Lambdas
11. Java DSL
11.1. DSL Basics
11.2. Message Channels
11.3. Pollers
11.4. DSL and Endpoint Configuration
11.5. Transformers
11.6. Inbound Channel Adapters
11.7. Message Routers
11.8. Splitters
11.9. Aggregators and Resequencers
11.10. Service Activators and the .handle() method
11.11. Operator log()
11.12. MessageChannelSpec.wireTap()
11.13. Working With Message Flows
11.14. FunctionExpression
11.15. Sub-flows support
11.16. Using Protocol Adapters
11.17. IntegrationFlowAdapter
11.18. Dynamic and Runtime Integration Flows
11.19. IntegrationFlow as Gateway
12. System Management
12.1. Metrics and Management
12.1.1. Configuring Metrics Capture
12.1.2. Micrometer Integration
12.1.3. MessageChannel Metric Features
12.1.4. MessageHandler Metric Features
12.1.5. Time-Based Average Estimates
12.1.6. Metrics Factory
Customizing the Default Channel and Handler Statistics
Advanced Customization
Performance Improvement
12.2. JMX Support
12.2.1. Notification-listening Channel Adapter
12.2.2. Notification-publishing Channel Adapter
12.2.3. Attribute-polling Channel Adapter
12.2.4. Tree-polling Channel Adapter
12.2.5. Operation-invoking Channel Adapter
12.2.6. Operation-invoking Outbound Gateway
12.2.7. MBean Exporter
MBean Object Names
JMX Improvements
Orderly Shutdown Managed Operation
12.3. Message History
12.3.1. Message History Configuration
12.4. Message Store
12.4.1. Using MessageGroupFactory
12.4.2. Persistent MessageGroupStore and Lazy-load
12.5. Metadata Store
12.5.1. Idempotent Receiver and Metadata Store
12.5.2. MetadataStoreListener
12.6. Control Bus
12.7. Orderly Shutdown
12.8. Integration Graph
12.8.1. Graph Runtime Model
12.9. Integration Graph Controller
V. Integration Endpoints
13. Endpoint Quick Reference Table
14. AMQP Support
14.1. Inbound Channel Adapter
14.1.1. Configuring with Java Configuration
14.1.2. Configuring with the Java DSL
14.2. Polled Inbound Channel Adapter
14.3. Inbound Gateway
14.3.1. Configuring with Java Configuration
14.3.2. Configuring with the Java DSL
14.4. Inbound Endpoint Acknowledge Mode
14.5. Outbound Channel Adapter
14.5.1. Configuring with Java Configuration
14.5.2. Configuring with the Java DSL
14.6. Outbound Gateway
14.6.1. Configuring with Java Configuration
14.6.2. Configuring with the Java DSL
14.7. Asynchronous Outbound Gateway
14.7.1. Configuring with Java Configuration
14.7.2. Configuring with the Java DSL
14.8. Outbound Message Conversion
14.9. Outbound User ID
14.10. Delayed Message Exchange
14.11. AMQP-backed Message Channels
14.11.1. Configuring with Java Configuration
14.11.2. Configuring with the Java DSL
14.12. AMQP Message Headers
14.12.1. Overview
14.12.2. contentType Header
14.13. Strict Message Ordering
14.13.1. Inbound
14.13.2. Outbound
14.14. AMQP Samples
15. Spring ApplicationEvent Support
15.1. Receiving Spring Application Events
15.2. Sending Spring Application Events
16. Feed Adapter
16.1. Feed Inbound Channel Adapter
16.2. Duplicate Entries
16.3. Other Options
16.4. Java DSL Configuration
17. File Support
17.1. Reading Files
17.1.1. Message Headers
17.1.2. Directory Scanning and Polling
17.1.3. Namespace Support
17.1.4. WatchServiceDirectoryScanner
17.1.5. Limiting Memory Consumption
17.1.6. Configuring with Java Configuration
17.1.7. Configuring with the Java DSL
17.1.8. 'tail’ing Files
17.1.9. Dealing With Incomplete Data
17.2. Writing files
17.2.1. Generating File Names
17.2.2. Specifying the Output Directory
Using the directory Attribute
Using the directory-expression Attribute
Using the auto-create-directory Attribute
17.2.3. Dealing with Existing Destination Files
17.2.4. Flushing Files When Using APPEND_NO_FLUSH
17.2.5. File Timestamps
17.2.6. File Permissions
17.2.7. File Outbound Channel Adapter
17.2.8. Outbound Gateway
17.2.9. Configuring with Java Configuration
17.2.10. Configuring with the Java DSL
17.3. File Transformers
17.4. File Splitter
17.4.1. Configuring with Java Configuration
17.4.2. Configuring with the Java DSL
18. FTP/FTPS Adapters
18.1. FTP Session Factory
18.1.1. Default Factories
18.2. Advanced Configuration
18.2.1. FTPS and Shared SSLSession
18.3. Delegating Session Factory
18.4. FTP Inbound Channel Adapter
18.4.1. More on File Filtering and Incomplete Files
18.4.2. Poller Configuration Notes for the Inbound FTP Adapter
18.4.3. Recovering from Failures
18.4.4. Configuring with Java Configuration
18.4.5. Configuring with the Java DSL
18.4.6. Dealing With Incomplete Data
18.5. FTP Streaming Inbound Channel Adapter
18.5.1. Configuring with Java Configuration
18.6. Inbound Channel Adapters: Polling Multiple Servers and Directories
18.7. Inbound Channel Adapters: Controlling Remote File Fetching
18.8. FTP Outbound Channel Adapter
18.8.1. Avoiding Partially Written Files
18.8.2. Configuring with Java Configuration
18.8.3. Configuring with the Java DSL
18.9. FTP Outbound Gateway
18.9.1. Using the ls Command
18.9.2. Using the nlst Command
18.9.3. Using the get Command
18.9.4. Using the mget Command
18.9.5. Using the put Command
18.9.6. Using the rm Command
18.9.7. Using the mv Command
18.9.8. Additional Information about FTP Outbound Gateway Commands
18.9.9. Configuring with Java Configuration
18.9.10. Configuring with the Java DSL
18.9.11. Outbound Gateway Partial Success (mget and mput)
18.10. FTP Session Caching
18.11. Using RemoteFileTemplate
18.12. Using MessageSessionCallback
19. Pivotal GemFire and Apache Geode Support
19.1. Inbound Channel Adapter
19.2. Continuous Query Inbound Channel Adapter
19.3. Outbound Channel Adapter
19.4. Gemfire Message Store
19.5. Gemfire Lock Registry
19.6. Gemfire Metadata Store
20. HTTP Support
20.1. Http Inbound Components
20.2. HTTP Outbound Components
20.2.1. Using HttpRequestExecutingMessageHandler
20.2.2. Using Cookies
20.3. HTTP Namespace Support
20.3.1. Inbound
20.3.2. Request Mapping Support
20.3.3. Cross-origin Resource Sharing (CORS) Support
20.3.4. Response Status Code
20.3.5. URI Template Variables and Expressions
20.3.6. Outbound
20.3.7. Mapping URI Variables
20.3.8. Controlling URI Encoding
20.4. Configuring HTTP Endpoints with Java
20.5. Timeout Handling
20.5.1. HTTP Inbound Gateway
20.6. HTTP Proxy configuration
20.6.1. Standard Java Proxy configuration
20.6.2. Spring’s SimpleClientHttpRequestFactory
20.7. HTTP Header Mappings
20.8. Integration Graph Controller
20.9. HTTP Samples
20.9.1. Multipart HTTP Request — RestTemplate (Client) and Http Inbound Gateway (Server)
21. JDBC Support
21.1. Inbound Channel Adapter
21.1.1. Polling and Transactions
21.1.2. max-rows Versus max-messages-per-poll
21.2. Outbound Channel Adapter
21.2.1. Passing Parameters by Using SpEL Expressions
21.2.2. Using the PreparedStatement Callback
21.2.3. Batch Update
21.3. Outbound Gateway
21.4. JDBC Message Store
21.4.1. Initializing the Database
21.4.2. The Generic JDBC Message Store
21.4.3. Backing Message Channels
Supported Databases
Custom Message Insertion
Concurrent Polling
Priority Channel
21.4.4. Partitioning a Message Store
21.5. Stored Procedures
21.5.1. Supported Databases
21.5.2. Configuration
21.5.3. Common Configuration Attributes
21.5.4. Common Configuration Sub-Elements
21.5.5. Defining Parameter Sources
21.5.6. Stored Procedure Inbound Channel Adapter
21.5.7. Stored Procedure Outbound Channel Adapter
21.5.8. Stored Procedure Outbound Gateway
21.5.9. Examples
21.6. JDBC Lock Registry
21.7. JDBC Metadata Store
22. JPA Support
22.1. Functionality
22.2. Supported Persistence Providers
22.3. Java Implementation
22.4. Namespace Support
22.4.1. Common XML Namespace Configuration Attributes
22.4.2. Providing JPA Query Parameters
22.4.3. Transaction Handling
22.5. Inbound Channel Adapter
22.5.1. Configuration Parameter Reference
22.5.2. Configuring with Java Configuration
22.5.3. Configuring with the Java DSL
22.6. Outbound Channel Adapter
22.6.1. Using an Entity Class
22.6.2. Using JPA Query Language (JPA QL)
22.6.3. Using Native Queries
22.6.4. Using Named Queries
22.6.5. Configuration Parameter Reference
22.6.6. Configuring with Java Configuration
22.6.7. Configuring with the Java DSL
22.7. Outbound Gateways
22.7.1. Common Configuration Parameters
22.7.2. Updating Outbound Gateway
22.7.3. Configuring with Java Configuration
22.7.4. Configuring with the Java DSL
22.7.5. Retrieving Outbound Gateway
22.7.6. Configuring with Java Configuration
22.7.7. Configuring with the Java DSL
22.7.8. JPA Outbound Gateway Samples
Update by Using an Entity Class
Update using JPQL
Retrieving an Entity using JPQL
Retrieving an Entity by Using id-expression
Update using a Named Query
23. JMS Support
23.1. Inbound Channel Adapter
23.1.1. Transactions
23.2. Message-driven Channel Adapter
23.2.1. Inbound Conversion Errors
23.3. Outbound Channel Adapter
23.3.1. Transactions
23.4. Inbound Gateway
23.5. Outbound Gateway
23.5.1. Using a <reply-listener/>
23.5.2. Idle Reply Listeners
23.5.3. Gateway Reply Correlation
23.5.4. Async Gateway
23.5.5. Attribute Reference
23.6. Mapping Message Headers to and from JMS Message
23.7. Message Conversion, Marshalling, and Unmarshalling
23.8. JMS-backed Message Channels
23.9. Using JMS Message Selectors
23.10. JMS Samples
24. Mail Support
24.1. Mail-sending Channel Adapter
24.2. Mail-receiving Channel Adapter
24.3. Inbound Mail Message Mapping
24.4. Mail Namespace Support
24.4.1. IMAP idle and Lost Connections
24.5. Marking IMAP Messages When \Recent Is Not Supported
24.6. Email Message Filtering
24.7. Transaction Synchronization
25. MongoDb Support
25.1. Connecting to MongoDb
25.1.1. Using MongoDbFactory
25.2. MongoDB Message Store
25.2.1. MongoDB Channel Message Store
25.2.2. MongoDB Metadata Store
25.3. MongoDB Inbound Channel Adapter
25.4. MongoDB Outbound Channel Adapter
25.5. MongoDB Outbound Gateway
25.5.1. Configuring with Java Configuration
25.5.2. Configuring with the Java DSL
26. MQTT Support
26.1. Inbound (Message-driven) Channel Adapter
26.1.1. Adding and Removing Topics at Runtime
26.1.2. Configuring with Java Configuration
26.1.3. Configuring with the Java DSL
26.2. Outbound Channel Adapter
26.2.1. Configuring with Java Configuration
26.2.2. Configuring with the Java DSL
27. Redis Support
27.1. Connecting to Redis
27.1.1. Using RedisConnectionFactory
27.1.2. Using RedisTemplate
27.2. Messaging with Redis
27.2.1. Redis Publish/Subscribe channel
27.2.2. Redis Inbound Channel Adapter
27.2.3. Redis Outbound Channel Adapter
27.2.4. Redis Queue Inbound Channel Adapter
27.2.5. Redis Queue Outbound Channel Adapter
27.2.6. Redis Application Events
27.3. Redis Message Store
27.3.1. Redis Channel Message Stores
27.4. Redis Metadata Store
27.5. Redis Store Inbound Channel Adapter
27.6. RedisStore Outbound Channel Adapter
27.7. Redis Outbound Command Gateway
27.8. Redis Queue Outbound Gateway
27.9. Redis Queue Inbound Gateway
27.10. Redis Lock Registry
28. Resource Support
28.1. Resource Inbound Channel Adapter
29. RMI Support
29.1. Outbound RMI
29.2. Inbound RMI
29.3. RMI namespace support
29.4. Configuring with Java Configuration
30. SFTP Adapters
30.1. SFTP Session Factory
30.1.1. Configuration Properties
30.2. Proxy Factory Bean
30.3. Delegating Session Factory
30.4. SFTP Session Caching
30.5. Using RemoteFileTemplate
30.6. SFTP Inbound Channel Adapter
30.6.1. More on File Filtering and Large Files
30.6.2. Recovering from Failures
30.6.3. Configuring with Java Configuration
30.6.4. Configuring with the Java DSL
30.6.5. Dealing With Incomplete Data
30.7. SFTP Streaming Inbound Channel Adapter
30.7.1. Configuring with Java Configuration
30.8. Inbound Channel Adapters: Polling Multiple Servers and Directories
30.9. Inbound Channel Adapters: Controlling Remote File Fetching
30.10. SFTP Outbound Channel Adapter
30.10.1. SpEL and the SFTP Outbound Adapter
30.10.2. Avoiding Partially Written Files
30.10.3. Configuring with Java Configuration
30.10.4. Configuring with the Java DSL
30.11. SFTP Outbound Gateway
30.11.1. Using the ls Command
30.11.2. Using the get Command
30.11.3. Using the mget Command
30.11.4. Using the put Command
30.11.5. Using the mput Command
30.11.6. Using the mv Command
30.11.7. Additional Command Information
30.11.8. Configuring with Java Configuration
30.11.9. Configuring with the Java DSL
30.11.10. Outbound Gateway Partial Success (mget and mput)
30.12. SFTP/JSCH Logging
30.13. MessageSessionCallback
31. STOMP Support
31.1. Overview
31.2. STOMP Inbound Channel Adapter
31.3. STOMP Outbound Channel Adapter
31.4. STOMP Headers Mapping
31.5. STOMP Integration Events
31.6. STOMP Adapters Java Configuration
31.7. STOMP Namespace Support
31.7.1. Understanding the <int-stomp:outbound-channel-adapter> Element
31.7.2. Understanding the <int-stomp:inbound-channel-adapter> Element
32. Stream Support
32.1. Reading from Streams
32.2. Writing to Streams
32.3. Stream Namespace Support
33. Syslog Support
33.1. Syslog Inbound Channel Adapter
33.1.1. Example Configuration
34. TCP and UDP Support
34.1. Introduction
34.2. UDP Adapters
34.2.1. Outbound UDP Adapters (XML Configuration)
34.2.2. Outbound UDP Adapters (Java Configuration)
34.2.3. Outbound UDP Adapters (Java DSL Configuration)
34.2.4. Inbound UDP Adapters (XML Configuration)
34.2.5. Inbound UDP Adapters (Java Configuration)
34.2.6. Inbound UDP Adapters (Java DSL Configuration)
34.2.7. Server Listening Events
34.2.8. Advanced Outbound Configuration
34.3. TCP Connection Factories
34.3.1. TCP Caching Client Connection Factory
34.3.2. TCP Failover Client Connection Factory
34.3.3. TCP Thread Affinity Connection Factory
34.4. TCP Connection Interceptors
34.5. TCP Connection Events
34.6. TCP Adapters
34.7. TCP Gateways
34.8. TCP Message Correlation
34.8.1. Gateways
34.8.2. Collaborating Outbound and Inbound Channel Adapters
34.8.3. Transferring Headers
34.9. About Non-blocking I/O (NIO)
34.9.1. Pool Size
34.9.2. Thread Pool Task Executor with CALLER_RUNS Policy
34.10. SSL/TLS Support
34.10.1. Getting Started
34.10.2. Host Verification
34.11. Advanced Techniques
34.11.1. Strategy Interfaces
The TcpSSLContextSupport Strategy Interface
The TcpSocketFactorySupport Strategy Interface
The TcpSocketSupport Strategy Interface
The TcpNetConnectionSupport Strategy Interface
The TcpNioConnectionSupport Strategy Interface
34.11.2. Example: Enabling SSL Client Authentication
34.12. IP Configuration Attributes
34.13. IP Message Headers
34.14. Annotation-Based Configuration
35. WebFlux Support
35.1. WebFlux Inbound Components
35.2. WebFlux Outbound Components
35.3. WebFlux Namespace Support
35.3.1. Inbound
35.3.2. Outbound
35.4. Configuring WebFlux Endpoints with Java
35.5. WebFlux Header Mappings
36. WebSockets Support
36.1. Overview
36.2. WebSocket Inbound Channel Adapter
36.3. WebSocket Outbound Channel Adapter
36.4. WebSockets Namespace Support
36.4.1. <int-websocket:client-container> Attributes
36.4.2. <int-websocket:server-container> Attributes
36.4.3. <int-websocket:outbound-channel-adapter> Attributes
36.4.4. <int-websocket:inbound-channel-adapter> Attributes
36.5. Using ClientStompEncoder
37. Web Services Support
37.1. Outbound Web Service Gateways
37.2. Inbound Web Service Gateways
37.3. Web Service Namespace Support
37.4. Outbound URI Configuration
37.4.1. Controlling URI Encoding
37.5. WS Message Headers
37.6. MTOM Support
38. XML Support - Dealing with XML Payloads
38.1. Namespace Support
38.1.1. XPath Expressions
Providing Namespaces (Optional) to XPath Expressions
Using XPath Expressions with Default Namespaces
38.2. Transforming XML Payloads
38.2.1. Configuring Transformers as Beans
UnmarshallingTransformer
Using MarshallingTransformer
XsltPayloadTransformer
Using ResultTransformer Implementations
38.2.2. Namespace Support for XML Transformers
Using an UnmarshallingTransformer
Using a MarshallingTransformer
Using an XsltPayloadTransformer
38.2.3. Namespace Configuration and Result Transformers
XsltPayloadTransformer and <xsl:output method="text"/>
38.3. Transforming XML Messages with XPath
38.3.1. Simple XPath Transformation
38.3.2. Node Mappers
38.3.3. XML Payload Converter
38.4. Splitting XML Messages
38.5. Routing XML Messages with XPath
38.5.1. XML Payload Converter
38.6. XPath Header Enricher
38.7. Using the XPath Filter
38.8. #xpath SpEL Function
38.9. XML Validating Filter
39. XMPP Support
39.1. XMPP Connection
39.2. XMPP Messages
39.2.1. Inbound Message Channel Adapter
39.2.2. Outbound Message Channel Adapter
39.3. XMPP Presence
39.3.1. Inbound Presence Message Channel Adapter
39.3.2. Outbound Presence Message Channel Adapter
39.4. Advanced Configuration
39.5. XMPP Message Headers
39.6. XMPP Extensions
40. Zookeeper Support
40.1. Zookeeper Metadata Store
40.2. Zookeeper Lock Registry
40.3. Zookeeper Leadership Event Handling
VI. Appendices
A. Spring Expression Language (SpEL)
A.1. SpEL Evaluation Context Customization
A.2. SpEL Functions
A.2.1. Built-in SpEL Functions
A.3. Property Accessors
B. Message Publishing
B.1. Message Publishing Configuration
B.1.1. Annotation-driven Configuration with the @Publisher Annotation
B.1.2. XML-based Approach with the <publishing-interceptor> element
Asynchronous Publishing
B.1.3. Producing and Publishing Messages Based on a Scheduled Trigger
C. Transaction Support
C.1. Understanding Transactions in Message flows
C.1.1. Poller Transaction Support
C.2. Transaction Boundaries
C.3. Transaction Synchronization
C.4. Pseudo Transactions
D. Security in Spring Integration
D.1. Securing channels
D.2. Security Context Propagation
E. Configuration
E.1. Namespace Support
E.2. Configuring the Task Scheduler
E.3. Error Handling
E.4. Global Properties
E.5. Annotation Support
E.5.1. Using the @Poller Annotation
E.5.2. Using the @InboundChannelAdapter Annotation
E.5.3. Using the @IntegrationComponentScan Annotation
E.6. Messaging Meta-Annotations
E.6.1. Annotations on @Bean Methods
E.6.2. Creating a Bridge with Annotations
E.6.3. Advising Annotated Endpoints
E.7. Message Mapping Rules and Conventions
E.7.1. Sample Scenarios
E.7.2. Annotation-based Mapping
E.7.3. Complex Scenarios
F. Testing support
F.1. Testing Utilities
F.1.1. TestUtils
F.1.2. Using the SocketUtils Class
F.1.3. Using OnlyOnceTrigger
F.1.4. Support Components
F.1.5. JUnit Rules and Conditions
F.1.6. Hamcrest and Mockito Matchers
F.2. Spring Integration and the Test Context
F.3. Integration Mocks
F.3.1. MockIntegration
F.4. Other Resources
G. Spring Integration Samples
G.1. Where to Get Samples
G.2. Submitting Samples or Sample Requests
G.2.1. How Can I Contribute My Own Samples?
G.2.2. Code Contribution Process
G.2.3. Sample Requests
G.3. Samples Structure
G.4. Samples
G.4.1. Loan Broker
Design
Composed Message Processor
G.4.2. The Cafe Sample
G.4.3. The XML Messaging Sample
H. Additional Resources
I. Change History
I.1. Changes between 4.3 and 5.0
I.2. New Components
I.2.1. Java DSL
I.2.2. Testing Support
I.2.3. MongoDB Outbound Gateway
I.2.4. WebFlux Gateways and Channel Adapters
I.2.5. Content Type Conversion
I.2.6. ErrorMessagePublisher and ErrorMessageStrategy
I.2.7. JDBC Metadata Store
I.3. General Changes
I.3.1. Core Changes
I.3.2. Gateway Changes
I.3.3. Aggregator Performance Changes
I.3.4. Splitter Changes
I.3.5. JMS Changes
I.3.6. Mail Changes
I.3.7. Feed Changes
I.3.8. File Changes
I.3.9. FTP and SFTP Changes
I.3.10. Integration Properties
I.3.11. Stream Changes
I.3.12. Barrier Changes
I.3.13. AMQP Changes
I.3.14. HTTP Changes
I.3.15. MQTT Changes
I.3.16. STOMP Changes
I.3.17. Web Services Changes
I.3.18. Redis Changes
I.3.19. TCP Changes
I.3.20. Gemfire Changes
I.3.21. JDBC Changes
I.3.22. Metrics Changes
I.3.23. @EndpointId Annotations
I.4. Changes between 4.2 and 4.3
I.5. New Components
I.5.1. AMQP Async Outbound Gateway
I.5.2. MessageGroupFactory
I.5.3. PersistentMessageGroup
I.5.4. FTP and SFTP Streaming Inbound Channel Adapters
I.5.5. StreamTransformer
I.5.6. Integration Graph
I.5.7. JDBC Lock Registry
I.5.8. LeaderInitiator for LockRegistry
I.6. General Changes
I.6.1. Core Changes
Outbound Gateway within a Chain
Asynchronous Service Activator
Messaging Annotation Support changes
I.6.2. Mail Changes
Customizable User Flag
Mail Message Mapping
I.6.3. JMS Changes
Header Mapper
Asynchronous Gateway
I.6.4. Aggregator Changes
I.6.5. TCP/UDP Changes
Events
Stream Deserializers
TCP Message Mapper
I.6.6. File Changes
Destination Directory Creation
Buffer Size
Appending and Flushing
Preserving Timestamps
Splitter Changes
File Filters
I.6.7. AMQP Changes
Content Type Message Converter
Headers for Delayed Message Handling
AMQP-Backed Channels
I.6.8. Redis Changes
List Push/Pop Direction
Queue Inbound Gateway Default Serializer
I.6.9. HTTP Changes
I.6.10. SFTP Changes
Factory Bean
chmod Changes
I.6.11. FTP Changes
Session Changes
I.6.12. Router Changes
I.6.13. Header Mapping
General
AMQP Header Mapping
I.6.14. Groovy Scripts
I.6.15. @InboundChannelAdapter Changes
I.6.16. XMPP Changes
I.6.17. WireTap Late Binding
I.6.18. ChannelMessageStoreQueryProvider Changes
I.6.19. WebSocket Changes
I.7. Changes between 4.1 and 4.2
I.8. New Components
I.8.1. Major Management/JMX Rework
I.8.2. MongoDB Metadata Store
I.8.3. SecuredChannel Annotation
I.8.4. SecurityContext Propagation
I.8.5. FileSplitter
I.8.6. Zookeeper Support
I.8.7. Thread Barrier
I.8.8. STOMP Support
I.8.9. Codec
I.8.10. Message PreparedStatement Setter
I.9. General Changes
I.9.1. WireTap
I.9.2. File Changes
Appending New Lines
Ignoring Hidden Files
Writing InputStream Payloads
HeadDirectoryScanner
Last Modified Filter
Watch Service Directory Scanner
Persistent File List Filter Changes
I.9.3. Class Package Change
I.9.4. TCP Changes
TCP Serializers
Server Socket Exceptions
TCP Server Port
TCP Gateway Remote Timeout
TCP SSLSession Available for Header Mapping
TCP Events
I.9.5. @InboundChannelAdapter Changes
I.9.6. API Changes
I.9.7. JMS Changes
Reply Listener Lazy Initialization
Conversion Errors in Message-Driven Endpoints
Default Acknowledge Mode
Shared Subscriptions
I.9.8. Conditional Pollers
I.9.9. AMQP Changes
Publisher Confirmations
Correlation Data
Inbound Gateway Properties
I.9.10. XPath Splitter Improvements
I.9.11. HTTP Changes
CORS
Inbound Gateway Timeout
Form Data
I.9.12. Gateway Changes
Gateway Methods can Return CompletableFuture<?>
MessagingGateway Annotation
I.9.13. Aggregator Changes
Aggregator Performance
Output Message Group Processor
I.9.14. FTP and SFTP Changes
Inbound Channel Adapters
Gateway Partial Results
Delegating Session Factory
Default Sftp Session Factory
Message Session Callback
I.9.15. Websocket Changes
I.9.16. Application Event Adapters changes
I.10. Changes between 4.0 and 4.1
I.10.1. New Components
Promise<?> Gateway
WebSocket support
Scatter-Gather Enterprise Integration Pattern
Routing Slip Pattern
Idempotent Receiver Pattern
Boon JsonObjectMapper
Redis Queue Gateways
PollSkipAdvice
I.10.2. General Changes
AMQP Inbound Endpoints, Channel
AMQP Outbound Endpoints
SimpleMessageStore
Web Service Outbound Gateway: encode-uri
Http Inbound Channel Adapter and Status Code
MQTT Adapter Changes
FTP and SFTP Adapter Changes
Splitter and Iterator
Aggregator
Content Enricher Improvements
Header Channel Registry
Orderly Shutdown
Management for RecipientListRouter
AbstractHeaderMapper: NON_STANDARD_HEADERS token
AMQP Channels: template-channel-transacted
Syslog Adapter
Asynchronous Gateway
Aggregator Advice Chain
Outbound Channel Adapter and Scripts
Resequencer Changes
Optional POJO method parameter
QueueChannel backed Queue type
ChannelInterceptor Changes
IMAP PEEK
I.11. Changes between 3.0 and 4.0
I.11.1. New Components
MQTT Channel Adapters
@EnableIntegration
@IntegrationComponentScan
"@EnableMessageHistory"
@MessagingGateway
Spring Boot @EnableAutoConfiguration
@GlobalChannelInterceptor
@IntegrationConverter
@EnablePublisher
Redis Channel Message Stores
MongodDB Channel Message Store
@EnableIntegrationMBeanExport
ChannelSecurityInterceptorFactoryBean
Redis Command Gateway
RedisLockRegistry and GemfireLockRegistry
@Poller
@InboundChannelAdapter and SmartLifecycle for Annotated Endpoints
Twitter Search Outbound Gateway
Gemfire Metadata Store
@BridgeFrom and @BridgeTo Annotations
Meta-messaging Annotations
I.11.2. General Changes
Requires Spring Framework 4.0
Header Type for XPath Header Enricher
Object To JSON Transformer: Node Result
JMS Header Mapping
JMS Outbound Channel Adapter
JMS Inbound Channel Adapter
Datatype Channels
Simpler Retry Advice Configuration
Correlation Endpoint: Time-based Release Strategy
Redis Metadata Store
JdbcChannelMessageStore and PriorityChannel
AMQP Endpoints Delivery Mode
FTP Timeouts
Twitter: StatusUpdatingMessageHandler
JPA Retrieving Gateway: id-expression
TCP Deserialization Events
Messaging Annotations on @Bean Definitions
I.12. Changes Between 2.2 and 3.0
I.12.1. New Components
HTTP Request Mapping
Spring Expression Language (SpEL) Configuration
SpEL Functions Support
SpEL PropertyAccessors Support
Redis: New Components
Header Channel Registry
MongoDB support: New ConfigurableMongoDbMessageStore
Syslog Support
tail Support
JMX Support
TCP/IP Connection Events and Connection Management
Inbound Channel Adapter Script Support
Content Enricher: Headers Enrichment Support
I.12.2. General Changes
Message ID Generation
"<gateway>" Changes
HTTP Endpoint Changes
Jackson Support (JSON)
Chain Elements id Attribute
Aggregator empty-group-min-timeout property
Persistent File List Filters (file, (S)FTP)
Scripting Support: Variables Changes
Direct Channel Load Balancing configuration
PublishSubscribeChannel Behavior
FTP, SFTP and FTPS Changes
requires-reply Attribute for Outbound Gateways
AMQP Outbound Gateway Header Mapping
Stored Procedure Components Improvements
Web Service Outbound URI Configuration
Redis Adapter Changes
Advising Filters
Advising Endpoints using Annotations
ObjectToStringTransformer Improvements
JPA Support Changes
Delayer: delay expression
JDBC Message Store Improvements
IMAP Idle Connection Exceptions
Message Headers and TCP
JMS Message Driven Channel Adapter
RMI Inbound Gateway
XsltPayloadTransformer
I.13. Changes between 2.1 and 2.2
I.13.1. New Components
RedisStore Inbound and Outbound Channel Adapters
MongoDB Inbound and Outbound Channel Adapters
JPA Endpoints
I.13.2. General Changes
Spring 3.1 Used by Default
Adding Behavior to Endpoints
Transaction Synchronization and Pseudo Transactions
File Adapter: Improved File Overwrite and Append Handling
Reply-Timeout Added to More Outbound Gateways
Spring-AMQP 1.1
JDBC Support - Stored Procedures Components
JDBC Support: Outbound Gateway
JDBC Support: Channel-specific Message Store Implementation
Orderly Shutdown
JMS Outbound Gateway Improvements
ObjectToJsonTransformer
HTTP Support
I.14. Changes between 2.0 and 2.1
I.14.1. New Components
JSR-223 Scripting Support
GemFire Support
AMQP Support
MongoDB Support
Redis Support
Support for Spring’s Resource abstraction
Stored Procedure Components
XPath and XML Validating Filter
Payload Enricher
FTP and SFTP Outbound Gateways
FTP Session Caching
I.14.2. Framework Refactoring
Standardizing Router Configuration
XML Schemas updated to 2.1
I.14.3. Source Control Management and Build Infrastructure
Source Code Now Hosted on Github
Improved Source Code Visibility with Sonar
I.14.4. New Samples
I.15. Changes between Versions 1.0 and 2.0
I.15.1. Spring 3 support
Support for the Spring Expression Language (SpEL)
Conversion Service and Converter
TaskScheduler and Trigger
RestTemplate and HttpMessageConverter
I.15.2. Enterprise Integration Pattern Additions
Message History
Message Store
Claim Check
Control Bus
I.15.3. New Channel Adapters and Gateways
TCP and UDP Adapters
Twitter Adapters
XMPP Adapters
FTP and FTPS Adapters
SFTP Adapters
Feed Adapters
I.15.4. Other Additions
Groovy Support
Map Transformers
JSON Transformers
Serialization Transformers
I.15.5. Framework Refactoring
I.15.6. New Source Control Management and Build Infrastructure
I.15.7. New Spring Integration Samples
I.15.8. Spring Tool Suite Visual Editor for Spring Integration