Spring integration 使用jms出站网关时如何处理超时异常?

Spring integration 使用jms出站网关时如何处理超时异常?,spring-integration,Spring Integration,我有一个jms出站网关,如下所示: <jms:outbound-gateway request-destination = "requestQueue" reply-destination="replayQueue" request-channel="sendToJmsChannel" reply-channel="receiveFromJmsChannel" receive-timeout="5000"/> 在我的spring集成流中,我向“se

我有一个jms出站网关,如下所示:

<jms:outbound-gateway request-destination = "requestQueue"
    reply-destination="replayQueue"
    request-channel="sendToJmsChannel"
    reply-channel="receiveFromJmsChannel" 
    receive-timeout="5000"/>
在我的spring集成流中,我向“sendToJmsChannel”发送请求,并处理来自“receiveFromJmsChannel”的回复

问题是,当接收超时已过且没有回复返回到回复目的地时,如何处理这种情况

JmsOutboundGateway thorws:

如果超时,默认情况下为5秒

您可以在中配置,以便将相同的消息重新发送到该MessageTimeoutException上的请求目标。或者,如果您的流从或消息驱动的ednpoint开始,则只需通过常规的try…catch从调用者处处理它,或者在错误通道上的ErrorHandler中处理它

否则就不清楚你的目标是什么。Spring集成中的异常没有像典型Java应用程序中那样提供更高的复杂性

throw new MessageTimeoutException(message,
                        "failed to receive JMS response within timeout of: " + this.receiveTimeout + "ms");