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 yourlogicHard
flow from theExecutorChannel
with respectiveExecutor
injected. OrQueueChannel
. SeeIntegrationFlows
factory and its:See that
MessageChannels
factory.On the other hand if you talk about a parallel logic, then it is indeed better to take a look into the
PublishSubscribeChannel
with anExecutor
option. YourlogicHard
flow logic might remain. Only what you need to have a globalPublishSubscribeChannel
bean 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.