multithreadinghttpsplitspring-integrationweb-container

How splitting in spring integration works for web container?


I want to use Spring Integration for HTTP inbound message processing.

I know, that it spring integration channel would run on a container thread, but if I want to use splits, what threads would be used?

How the result of split would be returned to the initial web request thread?


Solution

  • (Note: I am not 100% sure if I understand you use case, but as a general remark:)

    The spring integration spitter splits a message in multiple "smaller" messages. This is unrelated to multi-threading, that is, it does not per-se imply that the smaller messages are processed in parallel. It is still a sequential stream of smaller messages.

    You can then process the smaller messages in parallel, by defining a handler with a given parallelism and you can define that this handler uses a dedicated thread pool.

    (Sorry if this does not answer your question, please clarify).