1
votes

Spring integration has excellent example to TCP Server. But it seems to be using single thread for every socket connection.

Is there any example on how to create TCP Server which can process requests with multiple threads? Better yet, is there any example to use thread pooling in TCP Server.

I would appreciate if you can provide any links.

Thanks

1
If you could link to the example you are talking about, that would be helpful. - Warren Dew
TCP Client Server example is at github.com/spring-projects/spring-integration-samples/tree/… . To test with multi threads, add a delay in EchoService. You can use junit tests to send requests or JMeter. - kevin

1 Answers

1
votes

Set using-nio="true" when processing a large number of sockets and a thread pool is shared across the connections.

For a small number of sockets it's generally faster to use a single thread per socket.