Backport of https://github.com/spring-projects/spring-integration/pull/10858
Backport of #10858