liveBook · Manning

Outbound channel adapter

As explained in Spring in Action, Sixth Edition

An outbound channel adapter is an integration endpoint that sends messages from a channel to an external system or resource without generating a reply message.

An outbound channel adapter is the endpoint where an integration flow hands its final message to an application or external system. Unlike a gateway, it sends the message onward without producing a reply message. section 10.2.8

A typical outbound file flow works like this:

  • A gateway publishes a message to textInChannel. section 10.1.1
  • A transformer converts the payload to uppercase and publishes it to the next channel. section 10.1.1
  • The outbound channel adapter receives the message and writes its payload to a file, using the file_name header for the filename. section 10.1.1
  • An existing file can be appended to with a newline instead of overwritten. section 10.1.1

Spring Integration can define the same outbound flow with XML, Java configuration, or the Java DSL. The DSL represents the flow as one bean: receive from a channel, transform the payload, handle it with Files.outboundAdapter(), and call get() to build the IntegrationFlow. section 10.1.3

Writing transformed messages to a directory

A DSL flow can read from textInChannel, uppercase each String, and hand the result to a file adapter configured for /tmp/sia6/files. Setting APPEND and appendNewLine(true) preserves existing content while separating appended messages. section 10.1.3

How Spring in Action, Sixth Edition covers it

How deep it goes
Explains flow placement and file-writing configuration through XML and Java DSL examples, without covering adapter internals.
Examples
Uses a file-writing flow that uppercases messages and appends them to files selected by message headers.
What it assumes
Assumes basic Spring Integration concepts such as messages and channels while defining the adapter’s role through a concrete flow.
What you can do after
Build it from scratch with Spring Integration XML or Java DSL to deliver channel messages to files.
How it connects
Connects channels, gateways, transformers, message handlers, integration flows, and endpoint modules.

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Spring in Action, Sixth Edition. The section links point to the parts of the book it draws on.