Files
spring-integration-samples/intermediate/tcp-client-server-multiplex
Artem Bilan ea3ba21249 INTSAMPLES-122: Migrate to Gradle
JIRA: https://jira.springsource.org/browse/INTSAMPLES-122

INTSAMPLES-122: Polishing

INTSAMPLES-122: Add generated poms

* Upgrade some dependencies

INTSAMPLES-122: Cover Java/DSL sample

INTSAMPLES-122: Upgrade to SI 4.0.1 & SF 4.0.5

INTSAMPLES-122: Polishing according PR comments

Make gradlew executable
2014-05-28 12:58:25 -04:00
..
2014-05-28 12:58:25 -04:00

TCP Client-Server Multiplex Sample

If this is your first experience with the spring-integrtion-ip module, start with the tcp-client-server project in the basic folder.

That project uses outbound and inbound tcp gateways for communication. As discussed in the Spring Integration Reference Manual, this has some limitations for performance. If a shared socket (single-use="false") is used, only one message can be processed at a time (on the client side); we must wait for the response to the current request before we can send the next request. Otherwise, because only the payload is sent over tcp, the framework cannot correlate responses to requests.

An alternative is to use a new socket for each message, but this comes with a performance overhead. The solution is to use Collaborating Channel Adapters (see SI Reference Manual). In such a scenario, we can send multiple requests before a response is received. This is termed multiplexing.

This sample demonstrates how to configure collaborating channel adapters, on both the client and server sides, and one technique for correlating the responses to the corresponding request.