The root of the issue is the order of bean registration in the beanFactory. In this case the first subflows is registered correctly, but the next one has been registered after `RouterSubFlowMappingProvider`. In this case the input `channel` of the next subflow hasn't been registered yet, hence `NPE` in the `this.router.setChannelMapping` from `@PostConstruct` of `RouterSubFlowMappingProvider`. Move the `RouterSubFlowMappingProvider` to end of `componentsToRegister` collection to give a chance to register all subflows before the `RouterSubFlowMappingProvider`.
Spring Integration Java DSL
See the Spring Integration Java DSL Reference for more info.