Spring Integration: adapters, channels and routing
Prerequisites: 01-ecosystem
How does one input become two processing paths?
Goal & mental model verified
Spring Integration models messages passing through channels and endpoints. Adapters connect external systems; transformers change representation; routers select destinations. Channel type affects threading and delivery behavior.
[S40] [S53]Worked example · design exercise synthesis
An inbound insurer file adapter emits messages. A transformer normalizes records; a router sends valid records to underwriting and malformed ones to a review destination.
[S40] [S53]Engineering decision synthesis
Use integration flows when multiple protocols and routing rules need explicit composition. Prefer a direct service call for a simple local interaction; each extra channel adds behavior to understand.
[S40] [S53]Pitfall & diagnosis synthesis
Assuming every channel is asynchronous misreads the execution model. A slow endpoint can block a synchronous flow; unbounded asynchronous handoff can merely move overload into memory.
[S40] [S53]Improve & validate synthesis
Choose and document channel capacity and error handling. Simulate slow consumers and malformed messages; inspect queue depth, rejection behavior and recovery ownership.
[S40] [S53]Check yourself: Is every Spring Integration channel async?
No. Channel implementation determines handoff and threading behavior.