wsgateway无法在超时内向通道''发送消息:在spring集成中为-1

时间:2014-09-13 13:18:53

标签: spring spring-integration

我收到了这个错误。

org.springframework.messaging.MessageDeliveryException: failed to send message to channel 'org.springframework.integration.handler.MessageHandlerChain$ReplyForwardingMessageChannel@261b0001' within timeout: -1
    at org.springframework.messaging.core.GenericMessagingTemplate.doSend(GenericMessagingTemplate.java:112)
    at org.springframework.messaging.core.GenericMessagingTemplate.doSend(GenericMessagingTemplate.java:44)
    at org.springframework.messaging.core.AbstractMessageSendingTemplate.send(AbstractMessageSendingTemplate.java:94)
    at org.springframework.integration.handler.AbstractReplyProducingMessageHandler.sendMessage(AbstractReplyProducingMessageHandler.java:260)
    at org.springframework.integration.handler.AbstractReplyProducingMessageHandler.sendReplyMessage(AbstractReplyProducingMessageHandler.java:241)
    at org.springframework.integration.handler.AbstractReplyProducingMessageHandler.produceReply(AbstractReplyProducingMessageHandler.java:205)
    at org.springframework.integration.handler.AbstractReplyProducingMessageHandler.handleResult(AbstractReplyProducingMessageHandler.java:199)
    at org.springframework.integration.handler.AbstractReplyProducingMessageHandler.handleMessageInternal(AbstractReplyProducingMessageHandler.java:177)
    at org.springframework.integration.handler.AbstractMessageHandler.handleMessage(AbstractMessageHandler.java:78)
    at org.springframework.integration.handler.MessageHandlerChain.handleMessageInternal(MessageHandlerChain.java:131)
    at org.springframework.integration.handler.AbstractMessageHandler.handleMessage(AbstractMessageHandler.java:78)
    at org.springframework.integration.dispatcher.AbstractDispatcher.tryOptimizedDispatch(AbstractDispatcher.java:116)
    at org.springframework.integration.dispatcher.UnicastingDispatcher.doDispatch(UnicastingDispatcher.java:101)
    at org.springframework.integration.dispatcher.UnicastingDispatcher.dispatch(UnicastingDispatcher.java:97)

我的spring集成xml就是这样的。

<int-ws:inbound-gateway id="asmTestWSGateway" request-channel="webserviceInboundChannel" 
    reply-channel="outboundStartChannel" marshaller="asmMarshaller"
        unmarshaller="asmMarshaller" />

    <bean id="asmMarshaller" class="org.springframework.oxm.castor.CastorMarshaller">
        <property name="targetClasses" value="com.sds.redca.test.vo.DependencyVO"></property>
        <property name="mappingLocation" value="classpath:mapping-asm.xml"></property>  
    </bean> 
<int:chain input-channel="webserviceInboundChannel" output-channel="checkAuthentificationChannel">
        <int:service-activator> 
            <bean class="com.sds.redca.core.endpoint.activator.BuildMsgActivator" /> 
        </int:service-activator>
        <int:filter ref="sampleFilter" />
        <int:header-enricher>
            <int:header name="protocolType" value="#{T(com.sds.redca.cmm.RedCAConstants).WS_PROTOCOL}"/>
        </int:header-enricher>              
    </int:chain>    

    <int:chain input-channel="checkAuthentificationChannel" output-channel="outboundStartChannel">
        <int:service-activator> 
            <bean class="com.sds.redca.core.endpoint.activator.AuthentificationServiceActivator" /> 
        </int:service-activator>
    </int:chain>    

Webservice网关接收到肥皂消息,并将编组后的消息转换为vo对象。 并规范化并检查它是否有效,然后返回到回复通道以返回客户端。

我不知道如何解决这个问题。即使我进行日志级别调试,我也找不到原因。 任何帮助将不胜感激!

1 个答案:

答案 0 :(得分:2)

请显示您的outboundStartChannel配置。

当我们使用failed to send message to channel ... within timeout: -1并且无法克服其当前QueueChannel时,会发生capacity,因为没有足够的资源来发送poll来自该reply-channel的消息排队等待处理。

我根本没有看到你的用例在<int-ws:inbound-gateway>上使用output-channel="outboundStartChannel"的原因。只需将其从最后<chain>移除TemporaryReplyChannel即可。在这种情况下,依靠MessageHeaders中的short circuit来获得整个流程的{{1}}。