【发布时间】:2017-06-16 13:20:36
【问题描述】:
我已经为 TCP 集成创建了入站和出站适配器,以下是给定的配置。
<beans:description>
Uses conversion service and collaborating channel
adapters.
</beans:description>
<context:property-placeholder />
<!-- Client side -->
<gateway id="gw"
service-interface="com.project.configuration.ACDGateway"
default-reply-timeout="20000" default-request-channel="input"
default-reply-channel="gatewayChannel" />
<ip:tcp-connection-factory id="client" type="client"
host="10.90.7.31" port="42027" single-use="false"
serializer="MessageSerializerDeserializerService" deserializer="MessageSerializerDeserializerService"
so-timeout="10000" />
<publish-subscribe-channel id="input" />
<ip:tcp-outbound-channel-adapter id="outAdapter.client"
order="1" channel="input" connection-factory="client" /> <!-- Collaborator -->
<beans:bean id="MessageSerializerDeserializerService"
class="com.project.service.impl.MessageSerializerDeserializerService" />
<ip:tcp-inbound-channel-adapter id="inAdapter.client"
channel="recieve" connection-factory="client" /> <!-- Collaborator -->
<channel id="recieve" />
<header-enricher input-channel="recieve"
output-channel="gatewayChannel">
<header name="replyChannel"
value="gatewayChannel"/>
</header-enricher>
<channel id="gatewayChannel" />
当我运行它时,我会发送消息,但是当入站适配器收到响应时,会发生以下异常
标头中没有可用的输出通道。
然后我添加了一个处理元素以使用 header-enricher 添加该标头。在这之后我得到了
Exception in thread "pool-3-thread-1" java.lang.StackOverflowError
at org.springframework.beans.factory.support.AbstractBeanFactory.transformedBeanName(AbstractBeanFactory.java:1090)
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:239)
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:202)
at org.springframework.integration.support.channel.BeanFactoryChannelResolver.resolveDestination(BeanFactoryChannelResolver.java:88)
at org.springframework.integration.support.channel.BeanFactoryChannelResolver.resolveDestination(BeanFactoryChannelResolver.java:45)
at org.springframework.messaging.core.AbstractDestinationResolvingMessagingTemplate.resolveDestination(AbstractDestinationResolvingMessagingTemplate.java:73)
at org.springframework.messaging.core.AbstractDestinationResolvingMessagingTemplate.send(AbstractDestinationResolvingMessagingTemplate.java:67)
at org.springframework.integration.handler.AbstractMessageProducingHandler.sendOutput(AbstractMessageProducingHandler.java:300)
at org.springframework.integration.handler.AbstractMessageProducingHandler.produceOutput(AbstractMessageProducingHandler.java:212)
at org.springframework.integration.handler.AbstractMessageProducingHandler.sendOutputs(AbstractMessageProducingHandler.java:129)
at org.springframework.integration.handler.AbstractReplyProducingMessageHandler.handleMessageInternal(AbstractReplyProducingMessageHandler.java:115)
at org.springframework.integration.handler.AbstractMessageHandler.handleMessage(AbstractMessageHandler.java:127)
at org.springframework.integration.dispatcher.AbstractDispatcher.tryOptimizedDispatch(AbstractDispatcher.java:116)
at org.springframework.integration.dispatcher.UnicastingDispatcher.doDispatch(UnicastingDispatcher.java:148)
at org.springframework.integration.dispatcher.UnicastingDispatcher.dispatch(UnicastingDispatcher.java:121)
at org.springframework.integration.channel.AbstractSubscribableChannel.doSend(AbstractSubscribableChannel.java:77)
at org.springframework.integration.channel.AbstractMessageChannel.send(AbstractMessageChannel.java:423)
at org.springframework.integration.channel.AbstractMessageChannel.send(AbstractMessageChannel.java:373)
at org.springframework.messaging.core.GenericMessagingTemplate.doSend(GenericMessagingTemplate.java:115)
at org.springframework.messaging.core.GenericMessagingTemplate.doSend(GenericMessagingTemplate.java:45)
at org.springframework.messaging.core.AbstractDestinationResolvingMessagingTemplate.send(AbstractDestinationResolvingMessagingTemplate.java:68)
at org.springframework.integration.handler.AbstractMessageProducingHandler.sendOutput(AbstractMessageProducingHandler.java:300)
at org.springframework.integration.handler.AbstractMessageProducingHandler.produceOutput(AbstractMessageProducingHandler.java:212)
at org.springframework.integration.handler.AbstractMessageProducingHandler.sendOutputs(AbstractMessageProducingHandler.java:129)
at org.springframework.integration.handler.AbstractReplyProducingMessageHandler.handleMessageInternal(AbstractReplyProducingMessageHandler.java:115)
非常感谢任何帮助。
谢谢, 普拉尚特
【问题讨论】: