Spring集成tcp outbound和http inbound无法正常工作

时间:2016-08-14 11:05:47

标签: json spring http tcp integration

嘿,我坐在Spring Integration前几天没有快速进展。希望你能帮助我:

我的追踪:

Client.Input (POJO) 
   -> Client.[tcp-outbound].defaultserializer
   -> Server.[tcp-inbound].defaultserializer 
   -> Server.[http-outbound] -> transform(POJO-to-Json)
   -> Spring MVC Controller : return same POJO (automatic transform to json)
   -> Server -> transform(Json-to-POJO)
   -> Server -> defaultserializer
   -> Client -> defaultserializer

这里的配置:

客户端:     

<int:channel id="input" />

<int-ip:tcp-connection-factory id="client"
    type="client"
    host="192.168.178.28"
    port="5678"
    serializer="javaSerializer"
    deserializer="javaDeserializer"/>

<int-ip:tcp-outbound-gateway id="outboundGateway"
    request-channel="input"
    connection-factory="client"
    request-timeout="10000"
    reply-timeout="10000"/>

服务器端:

<int-ip:tcp-connection-factory id="connectionFactory"
    type="server"
    port="6000"
    serializer="javaSerializer"
    deserializer="javaDeserializer"/>

<int-ip:tcp-inbound-gateway id="inboundGateway"
    connection-factory="connectionFactory"
    request-channel="requestChannel"
    reply-channel="outboundChannel"/>

<int:channel id="requestChannel" />
<int:channel id="toMvcChannel" /> 
<int:channel id="toTcpChannel" /> 
<int:channel id="outboundChannel" />


<int:object-to-json-transformer input-channel="requestChannel"
                                output-channel="toMvcChannel"/>

<int:header-enricher input-channel="toMvcChannel">
    <int:header name="Content-Type" value="application/json" />
</int:header-enricher> 

<int-http:outbound-gateway
  url="http://localhost:10100/arx/dataset/receiveGateway"
                           request-channel="toMvcChannel"
                           reply-channel="toTcpChannel"/>



<int:json-to-object-transformer input-channel="toTcpChannel"
                                output-channel="outboundChannel"/>  

SimpleGateway:

public interface SimpleGateway {

public DefinitionServer send(DefinitionServer definition);}

我无法理解为什么我在客户端收到以下错误消息ON RECEIVE(路由的最后一步):

No converter found capable of converting from type [java.lang.String] to type [...DefinitionServer]

提前致谢!

0 个答案:

没有答案