Is it right to use "wiretap" as a second line logic channel?
Or I should use another methods? I not found anything appropriate (pubSubChannel?)
For example:
@Bean
HttpRequestHandlingMessagingGateway srvPutVers() {
return Http.inboundGateway("/srvPutVers")
.requestChannel("callLogicAndReply.input")
.requestPayloadType(SomeRq.class)
.get();
}
@Bean
IntegrationFlow callLogicAndReply() {
return f -> f
.wireTap("logicHard.input")
.transform(p -> "{\"status\": \"Ok\"}");
}
@Bean
IntegrationFlow logicHard() {
return f -> f
.log("hard logic");
}
If you want that
wireTap("logicHard.input")to be async, you need to start yourlogicHardflow from theExecutorChannelwith respectiveExecutorinjected. OrQueueChannel. SeeIntegrationFlowsfactory and its:See that
MessageChannelsfactory.On the other hand if you talk about a parallel logic, then it is indeed better to take a look into the
PublishSubscribeChannelwith anExecutoroption. YourlogicHardflow logic might remain. Only what you need to have a globalPublishSubscribeChannelbean and start that flow from this channel. In the main flow instead of.wireTap("logicHard.input")you need to use a plainchannel(myPublishSubscribeChannel())to refer to the same bean.