我在客户端收到多个响应
我能够读取服务器的响应,但在客户端收到此消息“无法关联响应 - 没有缓存的待处理回复:localhost:3002:46550:f6234e17-c486-4506-82c8-a757a08ba73d。”一分钟后,虽然服务器没有发回任何消息,但从服务器端,我可以看到日志中打印出这条消息“连接丢失:”127.0.0.1”。
@Bean
public AbstractClientConnectionFactory clientConnectionFactory() {
TcpNioClientConnectionFactory tcpNioClientConnectionFactory = new TcpNioClientConnectionFactory(host, port);
tcpNioClientConnectionFactory.setUsingDirectBuffers(true);
tcpNioClientConnectionFactory.setApplicationEventPublisher(applicationEventPublisher);
return new CachingClientConnectionFactory(tcpNioClientConnectionFactory, connectionPoolSize);
}
@Bean
public MessageChannel outboundChannel() {
return new DirectChannel();
}
@Bean
@ServiceActivator(inputChannel = "outboundChannel")
public MessageHandler outboundGateway(AbstractClientConnectionFactory clientConnectionFactory) {
TcpOutboundGateway tcpOutboundGateway = new TcpOutboundGateway();
tcpOutboundGateway.setConnectionFactory(clientConnectionFactory);
tcpOutboundGateway.setRemoteTimeout(Long.MAX_VALUE);
tcpOutboundGateway.setRequestTimeout(5_000);
return tcpOutboundGateway;
}
2022-03-22 13:14:46,878 [http-nio-9000-exec-4][][][][][][][] DEBUG org.springframework.integration.channel.DirectChannel - preSend on channel 'bean 'outboundChannel'; defined in: 'class path resource [com/wibmo/aerionpg/config/TcpClientConfig.class]'; from source: 'com.wibmo.aerionpg.config.TcpClientConfig.outboundChannel()'', message: GenericMessage [payload=byte[602], headers={replyChannel=org.springframework.messaging.core.GenericMessagingTemplate$TemporaryReplyChannel@2936326d, errorChannel=org.springframework.messaging.core.GenericMessagingTemplate$TemporaryReplyChannel@2936326d, id=062c0c73-addf-e90c-4b80-aebc70ec009b, timestamp=1647935086878}]
2022-03-22 13:14:46,878 [http-nio-9000-exec-4][][][][][][][] DEBUG org.springframework.integration.ip.tcp.TcpOutboundGateway - bean 'outboundGateway'; defined in: 'class path resource [com/wibmo/aerionpg/config/TcpClientConfig.class]'; from source: 'com.wibmo.aerionpg.config.TcpClientConfig.outboundGateway(org.springframework.integration.ip.tcp.connection.AbstractClientConnectionFactory)' received message: GenericMessage [payload=byte[602], headers={replyChannel=org.springframework.messaging.core.GenericMessagingTemplate$TemporaryReplyChannel@2936326d, errorChannel=org.springframework.messaging.core.GenericMessagingTemplate$TemporaryReplyChannel@2936326d, id=062c0c73-addf-e90c-4b80-aebc70ec009b, timestamp=1647935086878}]
2022-03-22 13:14:46,879 [http-nio-9000-exec-4][][][][][][][] DEBUG org.springframework.integration.util.SimplePool - Obtained TcpNioConnection:127.0.0.1:6001:54856:37e334df-5c89-4b51-af4f-727d0f484a29 from pool.
2022-03-22 13:14:46,879 [http-nio-9000-exec-4][][][][][][][] DEBUG org.springframework.integration.ip.tcp.TcpOutboundGateway - Added pending reply Cached:127.0.0.1:6001:54856:37e334df-5c89-4b51-af4f-727d0f484a29
2022-03-22 13:14:46,879 [http-nio-9000-exec-4][][][][][][][] DEBUG org.springframework.integration.ip.tcp.connection.TcpNioConnection - 127.0.0.1:6001:54856:37e334df-5c89-4b51-af4f-727d0f484a29 writing 604
2022-03-22 13:14:46,879 [http-nio-9000-exec-4][][][][][][][] DEBUG org.springframework.integration.ip.tcp.connection.TcpNioConnection - 127.0.0.1:6001:54856:37e334df-5c89-4b51-af4f-727d0f484a29 Message sent GenericMessage [payload=byte[602], headers={replyChannel=org.springframework.messaging.core.GenericMessagingTemplate$TemporaryReplyChannel@2936326d, errorChannel=org.springframework.messaging.core.GenericMessagingTemplate$TemporaryReplyChannel@2936326d, id=062c0c73-addf-e90c-4b80-aebc70ec009b, timestamp=1647935086878}]
2022-03-22 13:14:47,382 [pool-2-thread-1][][][][][][][] TRACE org.springframework.integration.ip.tcp.connection.TcpNioClientConnectionFactory - null: Connection is open: 127.0.0.1:6001:54856:37e334df-5c89-4b51-af4f-727d0f484a29
2022-03-22 13:14:47,382 [pool-2-thread-1][][][][][][][] TRACE org.springframework.integration.ip.tcp.connection.TcpNioClientConnectionFactory - Host 127.0.0.1 port 6001 SelectionCount: 1
2022-03-22 13:14:47,382 [pool-2-thread-2][][][][][][][] DEBUG org.springframework.integration.ip.tcp.connection.TcpNioConnection - 127.0.0.1:6001:54856:37e334df-5c89-4b51-af4f-727d0f484a29 Reading...
2022-03-22 13:14:47,382 [pool-2-thread-2][][][][][][][] DEBUG org.springframework.integration.ip.tcp.connection.TcpNioConnection - 127.0.0.1:6001:54856:37e334df-5c89-4b51-af4f-727d0f484a29 Running an assembler
2022-03-22 13:14:47,383 [pool-2-thread-2][][][][][][][] TRACE org.springframework.integration.ip.tcp.connection.TcpNioConnection - Before read: 0/61440
2022-03-22 13:14:47,383 [pool-2-thread-2][][][][][][][] TRACE org.springframework.integration.ip.tcp.connection.TcpNioConnection - After read: 614/61440
2022-03-22 13:14:47,383 [pool-2-thread-2][][][][][][][] TRACE org.springframework.integration.ip.tcp.connection.TcpNioConnection - After flip: 0/614
2022-03-22 13:14:47,383 [pool-2-thread-3][][][][][][][] TRACE org.springframework.integration.ip.tcp.connection.TcpNioConnection - 127.0.0.1:6001:54856:37e334df-5c89-4b51-af4f-727d0f484a29 Nio message assembler running...
2022-03-22 13:14:47,383 [pool-2-thread-3][][][][][][][] TRACE org.springframework.integration.ip.tcp.connection.TcpNioConnection - 127.0.0.1:6001:54856:37e334df-5c89-4b51-af4f-727d0f484a29 checking data avail: 0 pending: true
2022-03-22 13:14:47,383 [pool-2-thread-3][][][][][][][] TRACE org.springframework.integration.ip.tcp.connection.TcpNioConnection - 127.0.0.1:6001:54856:37e334df-5c89-4b51-af4f-727d0f484a29 checking data avail (convert): 0 pending: true
2022-03-22 13:14:47,383 [pool-2-thread-2][][][][][][][] DEBUG org.springframework.integration.ip.tcp.connection.TcpNioConnection - Read 614 into raw buffer
2022-03-22 13:14:47,383 [pool-2-thread-2][][][][][][][] TRACE org.springframework.integration.ip.tcp.connection.TcpNioConnection - 127.0.0.1:6001:54856:37e334df-5c89-4b51-af4f-727d0f484a29 Sending 614 to pipe
2022-03-22 13:14:47,383 [pool-2-thread-3][][][][][][][] DEBUG org.springframework.integration.ip.tcp.serializer.ByteArrayCrLfSerializer - Available to read: 614
2022-03-22 13:14:47,383 [pool-2-thread-1][][][][][][][] TRACE org.springframework.integration.ip.tcp.connection.TcpNioClientConnectionFactory - null: Connection is open: 127.0.0.1:6001:54856:37e334df-5c89-4b51-af4f-727d0f484a29
2022-03-22 13:14:47,383 [pool-2-thread-1][][][][][][][] TRACE org.springframework.integration.ip.tcp.connection.TcpNioClientConnectionFactory - Host 127.0.0.1 port 6001 SelectionCount: 0
2022-03-22 13:14:47,383 [pool-2-thread-3][][][][][][][] TRACE org.springframework.integration.ip.tcp.connection.TcpNioConnection - 127.0.0.1:6001:54856:37e334df-5c89-4b51-af4f-727d0f484a29 checking data avail: 0 pending: false
2022-03-22 13:14:47,383 [pool-2-thread-3][][][][][][][] TRACE org.springframework.integration.ip.tcp.TcpOutboundGateway - onMessage: Cached:127.0.0.1:6001:54856:37e334df-5c89-4b51-af4f-727d0f484a29(GenericMessage [payload=byte[612], headers={ip_tcp_remotePort=6001, ip_connectionId=Cached:127.0.0.1:6001:54856:37e334df-5c89-4b51-af4f-727d0f484a29, ip_actualConnectionId=127.0.0.1:6001:54856:37e334df-5c89-4b51-af4f-727d0f484a29, ip_localInetAddress=/127.0.0.1, ip_address=127.0.0.1, id=f9619787-4d0c-e894-ae05-f2eca0c4a1b4, ip_hostname=127.0.0.1, timestamp=1647935087383}])
2022-03-22 13:14:47,383 [pool-2-thread-3][][][][][][][] TRACE org.springframework.integration.ip.tcp.connection.TcpNioConnection - 127.0.0.1:6001:54856:37e334df-5c89-4b51-af4f-727d0f484a29 checking data avail: 0 pending: false
2022-03-22 13:14:47,383 [pool-2-thread-3][][][][][][][] TRACE org.springframework.integration.ip.tcp.connection.TcpNioConnection - 127.0.0.1:6001:54856:37e334df-5c89-4b51-af4f-727d0f484a29 Nio message assembler exiting... avail: 0
2022-03-22 13:14:47,383 [http-nio-9000-exec-4][][][][][][][] DEBUG org.springframework.integration.ip.tcp.TcpOutboundGateway - Response GenericMessage [payload=byte[612], headers={ip_tcp_remotePort=6001, ip_connectionId=Cached:127.0.0.1:6001:54856:37e334df-5c89-4b51-af4f-727d0f484a29, ip_actualConnectionId=127.0.0.1:6001:54856:37e334df-5c89-4b51-af4f-727d0f484a29, ip_localInetAddress=/127.0.0.1, ip_address=127.0.0.1, id=f9619787-4d0c-e894-ae05-f2eca0c4a1b4, ip_hostname=127.0.0.1, timestamp=1647935087383}]
2022-03-22 13:14:47,383 [http-nio-9000-exec-4][][][][][][][] DEBUG org.springframework.integration.ip.tcp.TcpOutboundGateway - Removed pending reply Cached:127.0.0.1:6001:54856:37e334df-5c89-4b51-af4f-727d0f484a29
2022-03-22 13:14:47,383 [http-nio-9000-exec-4][][][][][][][] DEBUG org.springframework.integration.util.SimplePool - Releasing TcpNioConnection:127.0.0.1:6001:54856:37e334df-5c89-4b51-af4f-727d0f484a29 back to the pool
2022-03-22 13:14:47,383 [http-nio-9000-exec-4][][][][][][][] DEBUG org.springframework.integration.channel.DirectChannel - postSend (sent=true) on channel 'bean 'outboundChannel'; defined in: 'class path resource [com/wibmo/aerionpg/config/TcpClientConfig.class]'; from source: 'com.wibmo.aerionpg.config.TcpClientConfig.outboundChannel()'', message: GenericMessage [payload=byte[602], headers={replyChannel=org.springframework.messaging.core.GenericMessagingTemplate$TemporaryReplyChannel@2936326d, errorChannel=org.springframework.messaging.core.GenericMessagingTemplate$TemporaryReplyChannel@2936326d, id=062c0c73-addf-e90c-4b80-aebc70ec009b, timestamp=1647935086878}]
2022-03-22 13:15:47,383 [pool-2-thread-1][][][][][][][] TRACE org.springframework.integration.ip.tcp.connection.TcpNioClientConnectionFactory - null: Connection is open: 127.0.0.1:6001:54856:37e334df-5c89-4b51-af4f-727d0f484a29
2022-03-22 13:15:47,383 [pool-2-thread-1][][][][][][][] TRACE org.springframework.integration.ip.tcp.connection.TcpNioClientConnectionFactory - Host 127.0.0.1 port 6001 SelectionCount: 1
2022-03-22 13:15:47,384 [pool-2-thread-3][][][][][][][] DEBUG org.springframework.integration.ip.tcp.connection.TcpNioConnection - 127.0.0.1:6001:54856:37e334df-5c89-4b51-af4f-727d0f484a29 Reading...
2022-03-22 13:15:47,384 [pool-2-thread-3][][][][][][][] DEBUG org.springframework.integration.ip.tcp.connection.TcpNioConnection - 127.0.0.1:6001:54856:37e334df-5c89-4b51-af4f-727d0f484a29 Running an assembler
2022-03-22 13:15:47,384 [pool-2-thread-3][][][][][][][] TRACE org.springframework.integration.ip.tcp.connection.TcpNioConnection - Before read: 0/61440
2022-03-22 13:15:47,384 [pool-2-thread-3][][][][][][][] TRACE org.springframework.integration.ip.tcp.connection.TcpNioConnection - After read: 14/61440
2022-03-22 13:15:47,384 [pool-2-thread-3][][][][][][][] TRACE org.springframework.integration.ip.tcp.connection.TcpNioConnection - After flip: 0/14
2022-03-22 13:15:47,384 [pool-2-thread-3][][][][][][][] DEBUG org.springframework.integration.ip.tcp.connection.TcpNioConnection - Read 14 into raw buffer
2022-03-22 13:15:47,384 [pool-2-thread-3][][][][][][][] TRACE org.springframework.integration.ip.tcp.connection.TcpNioConnection - 127.0.0.1:6001:54856:37e334df-5c89-4b51-af4f-727d0f484a29 Sending 14 to pipe
2022-03-22 13:15:47,384 [pool-2-thread-1][][][][][][][] TRACE org.springframework.integration.ip.tcp.connection.TcpNioClientConnectionFactory - null: Connection is open: 127.0.0.1:6001:54856:37e334df-5c89-4b51-af4f-727d0f484a29
2022-03-22 13:15:47,384 [pool-2-thread-1][][][][][][][] TRACE org.springframework.integration.ip.tcp.connection.TcpNioClientConnectionFactory - Host 127.0.0.1 port 6001 SelectionCount: 0
2022-03-22 13:15:47,384 [pool-2-thread-1][][][][][][][] TRACE org.springframework.integration.ip.tcp.connection.TcpNioClientConnectionFactory - null: Connection is open: 127.0.0.1:6001:54856:37e334df-5c89-4b51-af4f-727d0f484a29
2022-03-22 13:15:47,384 [pool-2-thread-1][][][][][][][] TRACE org.springframework.integration.ip.tcp.connection.TcpNioClientConnectionFactory - Host 127.0.0.1 port 6001 SelectionCount: 1
2022-03-22 13:15:47,384 [pool-2-thread-2][][][][][][][] TRACE org.springframework.integration.ip.tcp.connection.TcpNioConnection - 127.0.0.1:6001:54856:37e334df-5c89-4b51-af4f-727d0f484a29 Nio message assembler running...
2022-03-22 13:15:47,384 [pool-2-thread-2][][][][][][][] TRACE org.springframework.integration.ip.tcp.connection.TcpNioConnection - 127.0.0.1:6001:54856:37e334df-5c89-4b51-af4f-727d0f484a29 checking data avail: 14 pending: false
2022-03-22 13:15:47,384 [pool-2-thread-2][][][][][][][] TRACE org.springframework.integration.ip.tcp.connection.TcpNioConnection - 127.0.0.1:6001:54856:37e334df-5c89-4b51-af4f-727d0f484a29 checking data avail (convert): 14 pending: false
2022-03-22 13:15:47,384 [pool-2-thread-2][][][][][][][] DEBUG org.springframework.integration.ip.tcp.serializer.ByteArrayCrLfSerializer - Available to read: 14
2022-03-22 13:15:47,385 [pool-2-thread-2][][][][][][][] TRACE org.springframework.integration.ip.tcp.connection.TcpNioConnection - 127.0.0.1:6001:54856:37e334df-5c89-4b51-af4f-727d0f484a29 checking data avail: 0 pending: false
2022-03-22 13:15:47,385 [pool-2-thread-2][][][][][][][] TRACE org.springframework.integration.ip.tcp.TcpOutboundGateway - onMessage: Cached:127.0.0.1:6001:54856:37e334df-5c89-4b51-af4f-727d0f484a29(GenericMessage [payload=byte[12], headers={ip_tcp_remotePort=6001, ip_connectionId=Cached:127.0.0.1:6001:54856:37e334df-5c89-4b51-af4f-727d0f484a29, ip_actualConnectionId=127.0.0.1:6001:54856:37e334df-5c89-4b51-af4f-727d0f484a29, ip_localInetAddress=/127.0.0.1, ip_address=127.0.0.1, id=b9f23b01-6816-65f1-c1e9-f4cf1c21bccc, ip_hostname=127.0.0.1, timestamp=1647935147385}])
2022-03-22 13:15:47,385 [pool-2-thread-2][][][][][][][] ERROR org.springframework.integration.ip.tcp.TcpOutboundGateway - Cannot correlate response - no pending reply for Cached:127.0.0.1:6001:54856:37e334df-5c89-4b51-af4f-727d0f484a29
2022-03-22 13:15:47,386 [pool-2-thread-2][][][][][][][] TRACE org.springframework.integration.ip.tcp.connection.TcpNioConnection - 127.0.0.1:6001:54856:37e334df-5c89-4b51-af4f-727d0f484a29 checking data avail: 0 pending: false
2022-03-22 13:15:47,386 [pool-2-thread-2][][][][][][][] TRACE org.springframework.integration.ip.tcp.connection.TcpNioConnection - 127.0.0.1:6001:54856:37e334df-5c89-4b51-af4f-727d0f484a29 Nio message assembler exiting... avail: 0
2022-03-22 13:15:47,386 [pool-2-thread-3][][][][][][][] DEBUG org.springframework.integration.ip.tcp.connection.TcpNioConnection - 127.0.0.1:6001:54856:37e334df-5c89-4b51-af4f-727d0f484a29 Reading...
2022-03-22 13:15:47,386 [pool-2-thread-3][][][][][][][] DEBUG org.springframework.integration.ip.tcp.connection.TcpNioConnection - 127.0.0.1:6001:54856:37e334df-5c89-4b51-af4f-727d0f484a29 Running an assembler
2022-03-22 13:15:47,386 [pool-2-thread-2][][][][][][][] TRACE org.springframework.integration.ip.tcp.connection.TcpNioConnection - 127.0.0.1:6001:54856:37e334df-5c89-4b51-af4f-727d0f484a29 Nio message assembler running...
2022-03-22 13:15:47,386 [pool-2-thread-2][][][][][][][] TRACE org.springframework.integration.ip.tcp.connection.TcpNioConnection - 127.0.0.1:6001:54856:37e334df-5c89-4b51-af4f-727d0f484a29 checking data avail: 0 pending: true
2022-03-22 13:15:47,386 [pool-2-thread-2][][][][][][][] TRACE org.springframework.integration.ip.tcp.connection.TcpNioConnection - 127.0.0.1:6001:54856:37e334df-5c89-4b51-af4f-727d0f484a29 checking data avail (convert): 0 pending: true
2022-03-22 13:15:47,386 [pool-2-thread-3][][][][][][][] TRACE org.springframework.integration.ip.tcp.connection.TcpNioConnection - Before read: 0/61440
2022-03-22 13:15:47,386 [pool-2-thread-3][][][][][][][] DEBUG org.springframework.integration.ip.tcp.connection.CachingClientConnectionFactory$CachedConnection - Connection Cached:127.0.0.1:6001:54856:37e334df-5c89-4b51-af4f-727d0f484a29 has already been released
2022-03-22 13:15:47,387 [pool-2-thread-3][][][][][][][] TRACE org.springframework.integration.ip.tcp.connection.TcpNioConnection - Published: TcpConnectionCloseEvent [source=TcpNioConnection:127.0.0.1:6001:54856:37e334df-5c89-4b51-af4f-727d0f484a29], [factory=unknown, connectionId=127.0.0.1:6001:54856:37e334df-5c89-4b51-af4f-727d0f484a29] **CLOSED**
2022-03-22 13:15:47,387 [pool-2-thread-3][][][][][][][] TRACE org.springframework.integration.ip.tcp.connection.TcpNioConnection - After read: 0/61440
2022-03-22 13:15:47,387 [pool-2-thread-3][][][][][][][] TRACE org.springframework.integration.ip.tcp.connection.TcpNioConnection - After flip: 0/0
2022-03-22 13:15:47,387 [pool-2-thread-3][][][][][][][] DEBUG org.springframework.integration.ip.tcp.connection.TcpNioConnection - Read 0 into raw buffer
2022-03-22 13:15:47,387 [pool-2-thread-3][][][][][][][] TRACE org.springframework.integration.ip.tcp.connection.TcpNioConnection - 127.0.0.1:6001:54856:37e334df-5c89-4b51-af4f-727d0f484a29 Sending 0 to pipe
2022-03-22 13:15:47,387 [pool-2-thread-2][][][][][][][] TRACE org.springframework.integration.ip.tcp.connection.TcpNioConnection - 127.0.0.1:6001:54856:37e334df-5c89-4b51-af4f-727d0f484a29 checking data avail: 0 pending: false
2022-03-22 13:15:47,387 [pool-2-thread-2][][][][][][][] TRACE org.springframework.integration.ip.tcp.connection.TcpNioConnection - 127.0.0.1:6001:54856:37e334df-5c89-4b51-af4f-727d0f484a29 checking data avail: 0 pending: false
2022-03-22 13:15:47,387 [pool-2-thread-2][][][][][][][] TRACE org.springframework.integration.ip.tcp.connection.TcpNioConnection - 127.0.0.1:6001:54856:37e334df-5c89-4b51-af4f-727d0f484a29 Nio message assembler exiting... avail: 0
2022-03-22 13:15:47,387 [pool-2-thread-3][][][][][][][] TRACE org.springframework.integration.ip.tcp.TcpOutboundGateway - onMessage: Cached:127.0.0.1:6001:54856:37e334df-5c89-4b51-af4f-727d0f484a29(ErrorMessage [payload=java.io.EOFException: Connection is closed, headers={id=78de443c-cf7a-5e4d-89bc-0b8c4027b5a5, ip_connectionId=Cached:127.0.0.1:6001:54856:37e334df-5c89-4b51-af4f-727d0f484a29, timestamp=1647935147387, ip_actualConnectionId=127.0.0.1:6001:54856:37e334df-5c89-4b51-af4f-727d0f484a29}])
I am able to read the response from the server but I am getting this message on the client-side "cannot correlate response - no pending reply for cached:localhost:3002:46550:f6234e17-c486-4506-82c8-a757a08ba73d." after a minute, though the server is not sending any message back, From the server-side, I can see this message "Connection lost: " 127.0.0.1" printed out in the log.
@Bean
public AbstractClientConnectionFactory clientConnectionFactory() {
TcpNioClientConnectionFactory tcpNioClientConnectionFactory = new TcpNioClientConnectionFactory(host, port);
tcpNioClientConnectionFactory.setUsingDirectBuffers(true);
tcpNioClientConnectionFactory.setApplicationEventPublisher(applicationEventPublisher);
return new CachingClientConnectionFactory(tcpNioClientConnectionFactory, connectionPoolSize);
}
@Bean
public MessageChannel outboundChannel() {
return new DirectChannel();
}
@Bean
@ServiceActivator(inputChannel = "outboundChannel")
public MessageHandler outboundGateway(AbstractClientConnectionFactory clientConnectionFactory) {
TcpOutboundGateway tcpOutboundGateway = new TcpOutboundGateway();
tcpOutboundGateway.setConnectionFactory(clientConnectionFactory);
tcpOutboundGateway.setRemoteTimeout(Long.MAX_VALUE);
tcpOutboundGateway.setRequestTimeout(5_000);
return tcpOutboundGateway;
}
2022-03-22 13:14:46,878 [http-nio-9000-exec-4][][][][][][][] DEBUG org.springframework.integration.channel.DirectChannel - preSend on channel 'bean 'outboundChannel'; defined in: 'class path resource [com/wibmo/aerionpg/config/TcpClientConfig.class]'; from source: 'com.wibmo.aerionpg.config.TcpClientConfig.outboundChannel()'', message: GenericMessage [payload=byte[602], headers={replyChannel=org.springframework.messaging.core.GenericMessagingTemplate$TemporaryReplyChannel@2936326d, errorChannel=org.springframework.messaging.core.GenericMessagingTemplate$TemporaryReplyChannel@2936326d, id=062c0c73-addf-e90c-4b80-aebc70ec009b, timestamp=1647935086878}]
2022-03-22 13:14:46,878 [http-nio-9000-exec-4][][][][][][][] DEBUG org.springframework.integration.ip.tcp.TcpOutboundGateway - bean 'outboundGateway'; defined in: 'class path resource [com/wibmo/aerionpg/config/TcpClientConfig.class]'; from source: 'com.wibmo.aerionpg.config.TcpClientConfig.outboundGateway(org.springframework.integration.ip.tcp.connection.AbstractClientConnectionFactory)' received message: GenericMessage [payload=byte[602], headers={replyChannel=org.springframework.messaging.core.GenericMessagingTemplate$TemporaryReplyChannel@2936326d, errorChannel=org.springframework.messaging.core.GenericMessagingTemplate$TemporaryReplyChannel@2936326d, id=062c0c73-addf-e90c-4b80-aebc70ec009b, timestamp=1647935086878}]
2022-03-22 13:14:46,879 [http-nio-9000-exec-4][][][][][][][] DEBUG org.springframework.integration.util.SimplePool - Obtained TcpNioConnection:127.0.0.1:6001:54856:37e334df-5c89-4b51-af4f-727d0f484a29 from pool.
2022-03-22 13:14:46,879 [http-nio-9000-exec-4][][][][][][][] DEBUG org.springframework.integration.ip.tcp.TcpOutboundGateway - Added pending reply Cached:127.0.0.1:6001:54856:37e334df-5c89-4b51-af4f-727d0f484a29
2022-03-22 13:14:46,879 [http-nio-9000-exec-4][][][][][][][] DEBUG org.springframework.integration.ip.tcp.connection.TcpNioConnection - 127.0.0.1:6001:54856:37e334df-5c89-4b51-af4f-727d0f484a29 writing 604
2022-03-22 13:14:46,879 [http-nio-9000-exec-4][][][][][][][] DEBUG org.springframework.integration.ip.tcp.connection.TcpNioConnection - 127.0.0.1:6001:54856:37e334df-5c89-4b51-af4f-727d0f484a29 Message sent GenericMessage [payload=byte[602], headers={replyChannel=org.springframework.messaging.core.GenericMessagingTemplate$TemporaryReplyChannel@2936326d, errorChannel=org.springframework.messaging.core.GenericMessagingTemplate$TemporaryReplyChannel@2936326d, id=062c0c73-addf-e90c-4b80-aebc70ec009b, timestamp=1647935086878}]
2022-03-22 13:14:47,382 [pool-2-thread-1][][][][][][][] TRACE org.springframework.integration.ip.tcp.connection.TcpNioClientConnectionFactory - null: Connection is open: 127.0.0.1:6001:54856:37e334df-5c89-4b51-af4f-727d0f484a29
2022-03-22 13:14:47,382 [pool-2-thread-1][][][][][][][] TRACE org.springframework.integration.ip.tcp.connection.TcpNioClientConnectionFactory - Host 127.0.0.1 port 6001 SelectionCount: 1
2022-03-22 13:14:47,382 [pool-2-thread-2][][][][][][][] DEBUG org.springframework.integration.ip.tcp.connection.TcpNioConnection - 127.0.0.1:6001:54856:37e334df-5c89-4b51-af4f-727d0f484a29 Reading...
2022-03-22 13:14:47,382 [pool-2-thread-2][][][][][][][] DEBUG org.springframework.integration.ip.tcp.connection.TcpNioConnection - 127.0.0.1:6001:54856:37e334df-5c89-4b51-af4f-727d0f484a29 Running an assembler
2022-03-22 13:14:47,383 [pool-2-thread-2][][][][][][][] TRACE org.springframework.integration.ip.tcp.connection.TcpNioConnection - Before read: 0/61440
2022-03-22 13:14:47,383 [pool-2-thread-2][][][][][][][] TRACE org.springframework.integration.ip.tcp.connection.TcpNioConnection - After read: 614/61440
2022-03-22 13:14:47,383 [pool-2-thread-2][][][][][][][] TRACE org.springframework.integration.ip.tcp.connection.TcpNioConnection - After flip: 0/614
2022-03-22 13:14:47,383 [pool-2-thread-3][][][][][][][] TRACE org.springframework.integration.ip.tcp.connection.TcpNioConnection - 127.0.0.1:6001:54856:37e334df-5c89-4b51-af4f-727d0f484a29 Nio message assembler running...
2022-03-22 13:14:47,383 [pool-2-thread-3][][][][][][][] TRACE org.springframework.integration.ip.tcp.connection.TcpNioConnection - 127.0.0.1:6001:54856:37e334df-5c89-4b51-af4f-727d0f484a29 checking data avail: 0 pending: true
2022-03-22 13:14:47,383 [pool-2-thread-3][][][][][][][] TRACE org.springframework.integration.ip.tcp.connection.TcpNioConnection - 127.0.0.1:6001:54856:37e334df-5c89-4b51-af4f-727d0f484a29 checking data avail (convert): 0 pending: true
2022-03-22 13:14:47,383 [pool-2-thread-2][][][][][][][] DEBUG org.springframework.integration.ip.tcp.connection.TcpNioConnection - Read 614 into raw buffer
2022-03-22 13:14:47,383 [pool-2-thread-2][][][][][][][] TRACE org.springframework.integration.ip.tcp.connection.TcpNioConnection - 127.0.0.1:6001:54856:37e334df-5c89-4b51-af4f-727d0f484a29 Sending 614 to pipe
2022-03-22 13:14:47,383 [pool-2-thread-3][][][][][][][] DEBUG org.springframework.integration.ip.tcp.serializer.ByteArrayCrLfSerializer - Available to read: 614
2022-03-22 13:14:47,383 [pool-2-thread-1][][][][][][][] TRACE org.springframework.integration.ip.tcp.connection.TcpNioClientConnectionFactory - null: Connection is open: 127.0.0.1:6001:54856:37e334df-5c89-4b51-af4f-727d0f484a29
2022-03-22 13:14:47,383 [pool-2-thread-1][][][][][][][] TRACE org.springframework.integration.ip.tcp.connection.TcpNioClientConnectionFactory - Host 127.0.0.1 port 6001 SelectionCount: 0
2022-03-22 13:14:47,383 [pool-2-thread-3][][][][][][][] TRACE org.springframework.integration.ip.tcp.connection.TcpNioConnection - 127.0.0.1:6001:54856:37e334df-5c89-4b51-af4f-727d0f484a29 checking data avail: 0 pending: false
2022-03-22 13:14:47,383 [pool-2-thread-3][][][][][][][] TRACE org.springframework.integration.ip.tcp.TcpOutboundGateway - onMessage: Cached:127.0.0.1:6001:54856:37e334df-5c89-4b51-af4f-727d0f484a29(GenericMessage [payload=byte[612], headers={ip_tcp_remotePort=6001, ip_connectionId=Cached:127.0.0.1:6001:54856:37e334df-5c89-4b51-af4f-727d0f484a29, ip_actualConnectionId=127.0.0.1:6001:54856:37e334df-5c89-4b51-af4f-727d0f484a29, ip_localInetAddress=/127.0.0.1, ip_address=127.0.0.1, id=f9619787-4d0c-e894-ae05-f2eca0c4a1b4, ip_hostname=127.0.0.1, timestamp=1647935087383}])
2022-03-22 13:14:47,383 [pool-2-thread-3][][][][][][][] TRACE org.springframework.integration.ip.tcp.connection.TcpNioConnection - 127.0.0.1:6001:54856:37e334df-5c89-4b51-af4f-727d0f484a29 checking data avail: 0 pending: false
2022-03-22 13:14:47,383 [pool-2-thread-3][][][][][][][] TRACE org.springframework.integration.ip.tcp.connection.TcpNioConnection - 127.0.0.1:6001:54856:37e334df-5c89-4b51-af4f-727d0f484a29 Nio message assembler exiting... avail: 0
2022-03-22 13:14:47,383 [http-nio-9000-exec-4][][][][][][][] DEBUG org.springframework.integration.ip.tcp.TcpOutboundGateway - Response GenericMessage [payload=byte[612], headers={ip_tcp_remotePort=6001, ip_connectionId=Cached:127.0.0.1:6001:54856:37e334df-5c89-4b51-af4f-727d0f484a29, ip_actualConnectionId=127.0.0.1:6001:54856:37e334df-5c89-4b51-af4f-727d0f484a29, ip_localInetAddress=/127.0.0.1, ip_address=127.0.0.1, id=f9619787-4d0c-e894-ae05-f2eca0c4a1b4, ip_hostname=127.0.0.1, timestamp=1647935087383}]
2022-03-22 13:14:47,383 [http-nio-9000-exec-4][][][][][][][] DEBUG org.springframework.integration.ip.tcp.TcpOutboundGateway - Removed pending reply Cached:127.0.0.1:6001:54856:37e334df-5c89-4b51-af4f-727d0f484a29
2022-03-22 13:14:47,383 [http-nio-9000-exec-4][][][][][][][] DEBUG org.springframework.integration.util.SimplePool - Releasing TcpNioConnection:127.0.0.1:6001:54856:37e334df-5c89-4b51-af4f-727d0f484a29 back to the pool
2022-03-22 13:14:47,383 [http-nio-9000-exec-4][][][][][][][] DEBUG org.springframework.integration.channel.DirectChannel - postSend (sent=true) on channel 'bean 'outboundChannel'; defined in: 'class path resource [com/wibmo/aerionpg/config/TcpClientConfig.class]'; from source: 'com.wibmo.aerionpg.config.TcpClientConfig.outboundChannel()'', message: GenericMessage [payload=byte[602], headers={replyChannel=org.springframework.messaging.core.GenericMessagingTemplate$TemporaryReplyChannel@2936326d, errorChannel=org.springframework.messaging.core.GenericMessagingTemplate$TemporaryReplyChannel@2936326d, id=062c0c73-addf-e90c-4b80-aebc70ec009b, timestamp=1647935086878}]
2022-03-22 13:15:47,383 [pool-2-thread-1][][][][][][][] TRACE org.springframework.integration.ip.tcp.connection.TcpNioClientConnectionFactory - null: Connection is open: 127.0.0.1:6001:54856:37e334df-5c89-4b51-af4f-727d0f484a29
2022-03-22 13:15:47,383 [pool-2-thread-1][][][][][][][] TRACE org.springframework.integration.ip.tcp.connection.TcpNioClientConnectionFactory - Host 127.0.0.1 port 6001 SelectionCount: 1
2022-03-22 13:15:47,384 [pool-2-thread-3][][][][][][][] DEBUG org.springframework.integration.ip.tcp.connection.TcpNioConnection - 127.0.0.1:6001:54856:37e334df-5c89-4b51-af4f-727d0f484a29 Reading...
2022-03-22 13:15:47,384 [pool-2-thread-3][][][][][][][] DEBUG org.springframework.integration.ip.tcp.connection.TcpNioConnection - 127.0.0.1:6001:54856:37e334df-5c89-4b51-af4f-727d0f484a29 Running an assembler
2022-03-22 13:15:47,384 [pool-2-thread-3][][][][][][][] TRACE org.springframework.integration.ip.tcp.connection.TcpNioConnection - Before read: 0/61440
2022-03-22 13:15:47,384 [pool-2-thread-3][][][][][][][] TRACE org.springframework.integration.ip.tcp.connection.TcpNioConnection - After read: 14/61440
2022-03-22 13:15:47,384 [pool-2-thread-3][][][][][][][] TRACE org.springframework.integration.ip.tcp.connection.TcpNioConnection - After flip: 0/14
2022-03-22 13:15:47,384 [pool-2-thread-3][][][][][][][] DEBUG org.springframework.integration.ip.tcp.connection.TcpNioConnection - Read 14 into raw buffer
2022-03-22 13:15:47,384 [pool-2-thread-3][][][][][][][] TRACE org.springframework.integration.ip.tcp.connection.TcpNioConnection - 127.0.0.1:6001:54856:37e334df-5c89-4b51-af4f-727d0f484a29 Sending 14 to pipe
2022-03-22 13:15:47,384 [pool-2-thread-1][][][][][][][] TRACE org.springframework.integration.ip.tcp.connection.TcpNioClientConnectionFactory - null: Connection is open: 127.0.0.1:6001:54856:37e334df-5c89-4b51-af4f-727d0f484a29
2022-03-22 13:15:47,384 [pool-2-thread-1][][][][][][][] TRACE org.springframework.integration.ip.tcp.connection.TcpNioClientConnectionFactory - Host 127.0.0.1 port 6001 SelectionCount: 0
2022-03-22 13:15:47,384 [pool-2-thread-1][][][][][][][] TRACE org.springframework.integration.ip.tcp.connection.TcpNioClientConnectionFactory - null: Connection is open: 127.0.0.1:6001:54856:37e334df-5c89-4b51-af4f-727d0f484a29
2022-03-22 13:15:47,384 [pool-2-thread-1][][][][][][][] TRACE org.springframework.integration.ip.tcp.connection.TcpNioClientConnectionFactory - Host 127.0.0.1 port 6001 SelectionCount: 1
2022-03-22 13:15:47,384 [pool-2-thread-2][][][][][][][] TRACE org.springframework.integration.ip.tcp.connection.TcpNioConnection - 127.0.0.1:6001:54856:37e334df-5c89-4b51-af4f-727d0f484a29 Nio message assembler running...
2022-03-22 13:15:47,384 [pool-2-thread-2][][][][][][][] TRACE org.springframework.integration.ip.tcp.connection.TcpNioConnection - 127.0.0.1:6001:54856:37e334df-5c89-4b51-af4f-727d0f484a29 checking data avail: 14 pending: false
2022-03-22 13:15:47,384 [pool-2-thread-2][][][][][][][] TRACE org.springframework.integration.ip.tcp.connection.TcpNioConnection - 127.0.0.1:6001:54856:37e334df-5c89-4b51-af4f-727d0f484a29 checking data avail (convert): 14 pending: false
2022-03-22 13:15:47,384 [pool-2-thread-2][][][][][][][] DEBUG org.springframework.integration.ip.tcp.serializer.ByteArrayCrLfSerializer - Available to read: 14
2022-03-22 13:15:47,385 [pool-2-thread-2][][][][][][][] TRACE org.springframework.integration.ip.tcp.connection.TcpNioConnection - 127.0.0.1:6001:54856:37e334df-5c89-4b51-af4f-727d0f484a29 checking data avail: 0 pending: false
2022-03-22 13:15:47,385 [pool-2-thread-2][][][][][][][] TRACE org.springframework.integration.ip.tcp.TcpOutboundGateway - onMessage: Cached:127.0.0.1:6001:54856:37e334df-5c89-4b51-af4f-727d0f484a29(GenericMessage [payload=byte[12], headers={ip_tcp_remotePort=6001, ip_connectionId=Cached:127.0.0.1:6001:54856:37e334df-5c89-4b51-af4f-727d0f484a29, ip_actualConnectionId=127.0.0.1:6001:54856:37e334df-5c89-4b51-af4f-727d0f484a29, ip_localInetAddress=/127.0.0.1, ip_address=127.0.0.1, id=b9f23b01-6816-65f1-c1e9-f4cf1c21bccc, ip_hostname=127.0.0.1, timestamp=1647935147385}])
2022-03-22 13:15:47,385 [pool-2-thread-2][][][][][][][] ERROR org.springframework.integration.ip.tcp.TcpOutboundGateway - Cannot correlate response - no pending reply for Cached:127.0.0.1:6001:54856:37e334df-5c89-4b51-af4f-727d0f484a29
2022-03-22 13:15:47,386 [pool-2-thread-2][][][][][][][] TRACE org.springframework.integration.ip.tcp.connection.TcpNioConnection - 127.0.0.1:6001:54856:37e334df-5c89-4b51-af4f-727d0f484a29 checking data avail: 0 pending: false
2022-03-22 13:15:47,386 [pool-2-thread-2][][][][][][][] TRACE org.springframework.integration.ip.tcp.connection.TcpNioConnection - 127.0.0.1:6001:54856:37e334df-5c89-4b51-af4f-727d0f484a29 Nio message assembler exiting... avail: 0
2022-03-22 13:15:47,386 [pool-2-thread-3][][][][][][][] DEBUG org.springframework.integration.ip.tcp.connection.TcpNioConnection - 127.0.0.1:6001:54856:37e334df-5c89-4b51-af4f-727d0f484a29 Reading...
2022-03-22 13:15:47,386 [pool-2-thread-3][][][][][][][] DEBUG org.springframework.integration.ip.tcp.connection.TcpNioConnection - 127.0.0.1:6001:54856:37e334df-5c89-4b51-af4f-727d0f484a29 Running an assembler
2022-03-22 13:15:47,386 [pool-2-thread-2][][][][][][][] TRACE org.springframework.integration.ip.tcp.connection.TcpNioConnection - 127.0.0.1:6001:54856:37e334df-5c89-4b51-af4f-727d0f484a29 Nio message assembler running...
2022-03-22 13:15:47,386 [pool-2-thread-2][][][][][][][] TRACE org.springframework.integration.ip.tcp.connection.TcpNioConnection - 127.0.0.1:6001:54856:37e334df-5c89-4b51-af4f-727d0f484a29 checking data avail: 0 pending: true
2022-03-22 13:15:47,386 [pool-2-thread-2][][][][][][][] TRACE org.springframework.integration.ip.tcp.connection.TcpNioConnection - 127.0.0.1:6001:54856:37e334df-5c89-4b51-af4f-727d0f484a29 checking data avail (convert): 0 pending: true
2022-03-22 13:15:47,386 [pool-2-thread-3][][][][][][][] TRACE org.springframework.integration.ip.tcp.connection.TcpNioConnection - Before read: 0/61440
2022-03-22 13:15:47,386 [pool-2-thread-3][][][][][][][] DEBUG org.springframework.integration.ip.tcp.connection.CachingClientConnectionFactory$CachedConnection - Connection Cached:127.0.0.1:6001:54856:37e334df-5c89-4b51-af4f-727d0f484a29 has already been released
2022-03-22 13:15:47,387 [pool-2-thread-3][][][][][][][] TRACE org.springframework.integration.ip.tcp.connection.TcpNioConnection - Published: TcpConnectionCloseEvent [source=TcpNioConnection:127.0.0.1:6001:54856:37e334df-5c89-4b51-af4f-727d0f484a29], [factory=unknown, connectionId=127.0.0.1:6001:54856:37e334df-5c89-4b51-af4f-727d0f484a29] **CLOSED**
2022-03-22 13:15:47,387 [pool-2-thread-3][][][][][][][] TRACE org.springframework.integration.ip.tcp.connection.TcpNioConnection - After read: 0/61440
2022-03-22 13:15:47,387 [pool-2-thread-3][][][][][][][] TRACE org.springframework.integration.ip.tcp.connection.TcpNioConnection - After flip: 0/0
2022-03-22 13:15:47,387 [pool-2-thread-3][][][][][][][] DEBUG org.springframework.integration.ip.tcp.connection.TcpNioConnection - Read 0 into raw buffer
2022-03-22 13:15:47,387 [pool-2-thread-3][][][][][][][] TRACE org.springframework.integration.ip.tcp.connection.TcpNioConnection - 127.0.0.1:6001:54856:37e334df-5c89-4b51-af4f-727d0f484a29 Sending 0 to pipe
2022-03-22 13:15:47,387 [pool-2-thread-2][][][][][][][] TRACE org.springframework.integration.ip.tcp.connection.TcpNioConnection - 127.0.0.1:6001:54856:37e334df-5c89-4b51-af4f-727d0f484a29 checking data avail: 0 pending: false
2022-03-22 13:15:47,387 [pool-2-thread-2][][][][][][][] TRACE org.springframework.integration.ip.tcp.connection.TcpNioConnection - 127.0.0.1:6001:54856:37e334df-5c89-4b51-af4f-727d0f484a29 checking data avail: 0 pending: false
2022-03-22 13:15:47,387 [pool-2-thread-2][][][][][][][] TRACE org.springframework.integration.ip.tcp.connection.TcpNioConnection - 127.0.0.1:6001:54856:37e334df-5c89-4b51-af4f-727d0f484a29 Nio message assembler exiting... avail: 0
2022-03-22 13:15:47,387 [pool-2-thread-3][][][][][][][] TRACE org.springframework.integration.ip.tcp.TcpOutboundGateway - onMessage: Cached:127.0.0.1:6001:54856:37e334df-5c89-4b51-af4f-727d0f484a29(ErrorMessage [payload=java.io.EOFException: Connection is closed, headers={id=78de443c-cf7a-5e4d-89bc-0b8c4027b5a5, ip_connectionId=Cached:127.0.0.1:6001:54856:37e334df-5c89-4b51-af4f-727d0f484a29, timestamp=1647935147387, ip_actualConnectionId=127.0.0.1:6001:54856:37e334df-5c89-4b51-af4f-727d0f484a29}])
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
在我看来,服务器在 1 分钟后关闭套接字,但在此之前,它正在发送一条消息 - 14 字节;根据您的配置,大概是 12 个字节 +
\r\n
。从5.4版本开始,您可以向出站网关添加
unsolicitedMessageChannel
;这些额外的消息将发送到那里,而不是生成该日志消息。您可以添加消息处理程序(例如
@ServiceActivator
)以从该通道使用以查看内容是什么,或者您可以将其设置为“nullChannel”
以丢弃它。编辑
这是一个使用 Java DSL 的示例:
It looks to me like the server is closing the socket 1 minute later, but before doing that, it is sending a message - 14 bytes; presumably 12 bytes +
\r\n
, given your configuration.Starting with version 5.4, you can add an
unsolicitedMessageChannel
to the outbound gateway; these extra messages will be sent there, instead of generating that log message.You can add message handler (e.g.
@ServiceActivator
) to consume from that channel to see what the content is, or you can set it to"nullChannel"
to just discard it.EDIT
Here is an example, using the Java DSL: