Right now, the AbstractCorrelatingMessageHandler fails like:
Assert.isAssignable(Message.class, commonElementType, () ->
"The expected collection of Messages contains non-Message element: " + commonElementType);
if custom MessageGroupProcessor (which simply can be lambda) returns just a collection of payloads, but not messages.
The DefaultAggregateHeadersFunction can be used in this case to wrap that collection into a single message with grouped headers.
Similar to what happens in the AbstractAggregatingMessageGroupProcessor.
More info in: https://stackoverflow.com/questions/79253871/stop-execution-splitter