Nous utilisons l'intégration Spring 4.1.3.intégration de printemps exception tcp-out-bound
Implémenté le client à l'aide de la passerelle tcp-outbound.
Un paquet tcp rset a été reçu du serveur pendant la requête et une exception s'est produite. Quelle est la raison? Merci.
// interface
public interface TcpSendGateway {
public byte[] send(String text);
}
// send
byte[] response = sendGateway.send(request);
<int:gateway id="gw"
service-interface="com.mainpay.service.TcpSendGateway"
default-request-channel="input"
default-reply-channel="reply"/>
<int-tcp:tcp-connection-factory id="client"
type="client"
host="#{prop['app.cultureland.host']}"
port="#{prop['app.cultureland.port']}"
so-timeout="10000"
single-use="false"
so-keep-alive="true"
/>
<int:channel id="input" />
<int-tcp:tcp-outbound-gateway id="outGateway"
request-channel="input"
reply-channel="reply"
connection-factory="client"
request-timeout="10000"
reply-timeout="10000"
/>
<int:channel id="reply" datatype="java.lang.String" />
erreur LOG
▶ 17.09.29 17:07:37 [pool-2-thread-2] ERROR o.s.i.i.t.c.TcpNetConnection - Read exception 211.59.10.133:7611:51503:d2ec0199-fd15-49c0-bd99-0d864eb2145b SocketException:Connection reset
▶ 17.09.29 17:07:39 [http-nio-19900-exec-5] ERROR o.s.i.ip.tcp.TcpOutboundGateway - Tcp Gateway exception
org.springframework.messaging.MessagingException: Exception while awaiting reply; nested exception is java.net.SocketException: Connection reset
at org.springframework.integration.ip.tcp.TcpOutboundGateway$AsyncReply.getReply(TcpOutboundGateway.java:288)
Wireshark journal enter image description here
Merci beaucoup. tu m'as vraiment beaucoup aidé –