Je tente de créer un flux qui reçoit un message de 2 sources (1 mqtt et une d'une interaction de service utilisateur) et génère un message vers un autre mqtt. En fait, j'essayer d'utiliser cette réponse: How to crate Spring Integration Flow from two MessageProducerSpec?Flux d'intégration de source avec deux sources
Et voici mon résultat:
@Bean
public IntegrationFlow mqttInFlow() {
return IntegrationFlows.from(mqttInbound())
.channel("mainMessageChannel")
.get();
}
@Bean
public IntegrationFlow mqttTestMessageFlow() {
return IntegrationFlows.from(messageService.testInbound())
.channel("mainMessageChannel")
.get();
}
@Bean
public IntegrationFlow mainMessageFlow() {
return IntegrationFlows.from("mainMessageChannel")
.handle(eventServiceHandler())
.split(operationSplitter())
.handle(mqttOutbound())
.get();
}
Mais j'ai l'erreur suivante:
java.lang.IllegalStateException: 'outputChannel' or 'outputChannelName' is required
at org.springframework.util.Assert.state(Assert.java:70)
at org.springframework.integration.endpoint.MessageProducerSupport.afterSingletonsInstantiated(MessageProducerSupport.java:136)