【发布时间】:2014-11-06 14:11:25
【问题描述】:
我有一个 Spring 集成流,它通过 JMS 出站网关发送消息,该网关配置为接收超时 45 秒。我正在尝试通过在设置中发送消息来测试接收超时期限,在该设置中消息永远不会在另一端被消耗(因此响应不会回来)。但是,当我运行测试时,消息被放置在出站队列中,但是出站网关的接收超时从未发生(45 秒后)。有什么想法可能导致这种情况发生(没有发生)?
我的堆栈是:
o.s.i:spring-integration-java-dsl:1.0.0.M3
o.s.i:spring-integration-jms:4.0.4.RELEASE
我的 IntegrationgConfig.class:
@Configuration
@EnableIntegration
public class IntegrationConfig {
...
@Bean
public IntegrationFlow testFlow() {
return IntegrationFlows
.from("test.request.ch")
.handle(Jms.outboundGateway(connectionFactory)
.receiveTimeout(45000)
.requestDestination("REQUEST_QUEUE")
.replyDestination("RESPONSE_QUEUE")
.correlationKey("JMSCorrelationID"))
.handle("testService",
"testMethod")
.channel("test.response.ch").get();
}
...
}
在 JMS 配置方面,使用的连接工厂是标准的 CachingConnectionFactory,它以 MQConnectionFactory 为目标。
在此先感谢您提供任何帮助。 下午
--- 更新 ---
我已打开调试,我可以看到发生超时时会记录以下消息:
AbstractReplyProducingMessageHandler - handler 'org.springframework.integration.jms.JmsOutboundGateway#0' produced no reply for request Message: [Payload byte[835]][...]
只需要了解如何在流中捕获此事件?
--- 更新 2 ---
正在发送的消息上设置了一个 ERROR_CHANNEL 标头,我希望将超时异常路由到该标头 - 但此路由不会发生?
是否有可能是 CachingConnectionFactory 正在处理异常而不将其传递回流?
【问题讨论】:
标签: spring-integration spring-jms