-
Notifications
You must be signed in to change notification settings - Fork 1.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Spring integration service-interface gateway bridge should only forward message initiated by the gateway [INT-3660] #7619
Comments
Aodhagán Collins commented As per the stack overflow post http://stackoverflow.com/questions/28743577/spring-integration-service-interface-gateway-reply-channel-as-shared-pub-sub the solution I used was to get the gateway to add a header and then filter the replies. It would be great if the gateway did this itself. |
Gary Russell commented One solution might be to have each gateway add a However, losing headers (especially the We'll have to think about it some more; perhaps another solution would be some way to configure endpoints that don't expect a reply to insert Another workaround would be to add a |
Aodhagán Collins commented The thinking for adding the header to filter on was to future proof as I may add other gateways in the future so it would not be correct in that case to forward any message with a reply-channel. In fact that could cause undesirable behaviour in that the message could be forwarded to the reply-channel by all the BridgeHandlers added by the individual Gateways. |
Artem Bilan commented Adding The idea with the <header-enricher>
<reply-channel ref="nullChannel"/>
</header-enricher> This way can be just documented for this complex (unusual) scenario. The scenario with else if (alreadyReceivedReply) {
errorDescription = "Reply message received but the receiving thread has already received a reply";
}
...
if (errorDescription != null) {
if (logger.isWarnEnabled()) {
logger.warn(errorDescription + ":" + message);
}
if (this.throwExceptionOnLateReply) {
throw new MessageDeliveryException(message, errorDescription);
}
} So, you get a WARN in logs and I would suggest to stay away from such a scenario to avoid unexpected WARNs and exceptions. Nevertheless I see another solution like supply the |
I find this as a duplication of #3985. |
Aodhagán Collins opened INT-3660 and commented
I am using Spring integration to launch Spring batch jobs. I have a number of input routes e.g. file polling and http requests. These all route to a batch-int Job Launching Gateway. The referenced Job Launcher has a task executor so job launches are asynchronous. This gateway replies on a specified channel.
This specified channel 'jobLaunchReplyChannel' is pub/sub and has a logger listening to it. This channel is also used as the reply channel for a service-interface gateway.
The issue I am having is that when jobs are requested via sources that are not the gateway (e.g. the poller) the Bridge that is added by gateway throws an exception because no reply channel is set on replies.
Affects: 3.0.4
Reference URL: http://stackoverflow.com/questions/28743577/spring-integration-service-interface-gateway-reply-channel-as-shared-pub-sub
The text was updated successfully, but these errors were encountered: