Error handling in Spring integration flow async
<p>I have the following Spring Integration configuration that allows me to call a gateway method from MVC Controller and letting controller return, while integration flow will continue on its own in a separate thread that does not block controller.</p>

<p>However, I cannot figure out how to get my error handler to work for this async flow. My gateway has error channel defined, but my exceptions do not reach it for some reason. Instead, I see that <code>LoggingHandler</code> gets invoked.</p>

<pre><code>@Bean
IntegrationFlow mainInteractiveFlow() {
    return IntegrationFlows.from(
            MessageChannels.executor("input", executor))
            .split()
            .channel(MessageChannels.executor(executor))
            .transform(transformer)
            .handle(genericMessageHandler, "validate")
            .handle(genericMessageHandler, "checkSubscription")
            .handle(interactiveMessageService, "handle")
            .&lt;Task, String&gt;route(p -&gt; p.getKind().name(),
                    m -&gt; m.channelMapping(TaskKind.ABC.name(), "attachInteractiveChannel"))
            .get();
}

@Bean
IntegrationFlow attachInteractiveChannelFlow() {
    return IntegrationFlows.from(
            MessageChannels.direct("attachInteractiveChannel"))
            .handle(issueRouterService)
            .get();
}

@Bean
IntegrationFlow interactiveExceptionChannelFlow() {
    return IntegrationFlows.from(interactiveExceptionChannel())
            .handle(errorHandler, "handleErrorMessage")
            .get();
}

@Bean
MessageChannel interactiveExceptionChannel() {
    return MessageChannels.direct("interactiveExceptionChannel").get();
}
</code></pre>

<p>Gateway:</p>

<pre><code>@MessagingGateway(errorChannel = "interactiveExceptionChannel")
public interface InteractiveSlackGW {

    @Gateway(requestChannel = "input")
    void interactiveMessage(Collection&lt;Request&gt; messages);

}
</code></pre>

<p>What should I do in order to see my exceptions happening in the async integration flow being handled by my error handler?</p>