После обновления до весенней загрузки 2.1.6.RELEASE запуск приложения завершается неудачно:
Полевая интеграцияFlow в org.springframework.cloud.stream.binder.AbstractMessageChannelBinder требует одного компонента, но найдено 2 :...
Я пытаюсь вручную зарегистрировать потоки, используя класс IntegrationFlowContext.
@Component
public class FlowCreator{
@Autowired
private IntegrationFlowContext flowContext;
@Autowired
private FlowExample flowExample;
@PostConstruct
public void registerIntegrationFlows() {
flowContext.registration(flowExample.integrationFlow1())
.id("integrationFlow1")
.register();
flowContext.registration(flowExample.integrationFlow2())
.id("integrationFlow2")
.register();
}
@Component
public class FlowExample {
public IntegrationFlow integrationFlow1() {
return IntegrationFlows.from("input")
.<Object, Class<?>>route(Object::getClass, routeMessages()) //
.get();
}
private Consumer<RouterSpec<Class<?>, MethodInvokingRouter>> routeMessages() {
return m -> m //
.subFlowMapping(Boolean.class, subFlow1())
.subFlowMapping(Integer.class, subFlow2())
.defaultOutputChannel("discardChannel");
}
private IntegrationFlow subFlow1() {
return sf -> sf.channel("Channel1");
}
private IntegrationFlow subFlow2() {
return sf -> sf.channel("Channel2");
}
public IntegrationFlow integrationFlow2() {
return IntegrationFlows.from("input")
.channel("channel3")
.get();
}
}
Теперь я получаю следующую ошибку:
Интеграция поляFlow в org.springframework.cloud.stream.binder.AbstractMessageChannelBinder требует одного компонента, но найдено 2:
- integraFlow1.subFlow # 0: определено в нуле
- integraFlow1.subFlow # 1: определено в нуле