В Kotlin / Java, когда я пытаюсь отправить сообщение bytearray на TCP-сервер и получаю сообщение, я получаю исключение
org.springframework.messaging.MessagingException: Exception while awaiting reply; nested exception is java.io.IOException: Socket closed during message assembly
at org.springframework.integration.support.utils.IntegrationUtils.wrapInHandlingExceptionIfNecessary(IntegrationUtils.java:189)
at org.springframework.integration.handler.AbstractMessageHandler.handleMessage(AbstractMessageHandler.java:179)
at org.springframework.integration.dispatcher.AbstractDispatcher.tryOptimizedDispatch(AbstractDispatcher.java:115)
at org.springframework.integration.dispatcher.UnicastingDispatcher.doDispatch(UnicastingDispatcher.java:132)
at org.springframework.integration.dispatcher.UnicastingDispatcher.dispatch(UnicastingDispatcher.java:105)
at org.springframework.integration.channel.AbstractSubscribableChannel.doSend(AbstractSubscribableChannel.java:73)
at org.springframework.integration.channel.AbstractMessageChannel.send(AbstractMessageChannel.java:453)
at org.springframework.integration.channel.AbstractMessageChannel.send(AbstractMessageChannel.java:401)
at org.springframework.messaging.core.GenericMessagingTemplate.doSend(GenericMessagingTemplate.java:187)
at org.springframework.messaging.core.GenericMessagingTemplate.doSendAndReceive(GenericMessagingTemplate.java:233)
at org.springframework.messaging.core.GenericMessagingTemplate.doSendAndReceive(GenericMessagingTemplate.java:47)
at org.springframework.messaging.core.AbstractMessagingTemplate.sendAndReceive(AbstractMessagingTemplate.java:46)
Ниже приведен мой класс конфигурации TCP
@Configuration
class TcpIntegrationConfiguration(
private val tcpConfigurationProperties: TcpConfigurationProperties
) {
@Bean
fun tcpClient(): IntegrationFlow {
return IntegrationFlows.from(Gateway::class.java)
.handle(
Tcp.outboundGateway(
Tcp.netClient(
tcpConfigurationProperties.host, tcpConfigurationProperties.port)
.soTimeout(tcpConfigurationProperties.timeout)))
.get()
}
}
Любые ответы / предложения?