Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/api/5.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Spring integration 没有可用于发布TcpConnectionOpenEvent/TcpConnectionCloseEvent的发布服务器_Spring Integration_Spring Integration Dsl_Spring Integration Ip - Fatal编程技术网

Spring integration 没有可用于发布TcpConnectionOpenEvent/TcpConnectionCloseEvent的发布服务器

Spring integration 没有可用于发布TcpConnectionOpenEvent/TcpConnectionCloseEvent的发布服务器,spring-integration,spring-integration-dsl,spring-integration-ip,Spring Integration,Spring Integration Dsl,Spring Integration Ip,我用Spring集成的JavaDSL配置了一个TCP客户端。看起来像这样 @Bean 公共TcpSendingMessageHandler tcpClient() { 返回Tcp .outboundAdapter( nioClient(“localhost”,9060) .deserializer(新的ByteArrayLfSerializer()) .soKeepAlive(错误) .leaveOpen(假) .taskExecutor(Executors.newSingleThreadExe

我用Spring集成的JavaDSL配置了一个TCP客户端。看起来像这样

@Bean
公共TcpSendingMessageHandler tcpClient()
{
返回Tcp
.outboundAdapter(
nioClient(“localhost”,9060)
.deserializer(新的ByteArrayLfSerializer())
.soKeepAlive(错误)
.leaveOpen(假)
.taskExecutor(Executors.newSingleThreadExecutor())
.get()
)
.clientMode(错误)
.get();
}
我在服务中使用它向客户端连接的TCP套接字发送消息:

@Slf4j
@服务
公共类TcpClientConnectionService
{
私有最终TcpSendingMessageHandler messageHandler;
@自动连线
公共TcpClientConnectionService(最终TcpSendingMessageHandler messageHandler)
{
this.messageHandler=messageHandler;
this.messageHandler.start();
}
公共无效发送消息(最终字符串消息)
{
handleMessage(新的GenericMessage(message));
log.debug(“消息:“+消息+”发送”);
}
}
但在生产中,我经常收到以下警告,我不知道问题是什么,也不知道如何解决

o、 s.i.i.tcp.connection.TcpNioConnection:没有可用于 发布TcpConnectionOpenEvent o、 s.i.i.tcp.connection.TcpNioConnection:没有可用于 发布TcpConnectionCloseEvent


如果有人能帮助我,那就太好了,因为我无法通过谷歌搜索找到任何东西。

嵌套工厂没有正确初始化,因为您在规范上错误地调用了
.get()
,这破坏了Spring初始化

我用Spring集成的JavaDSL配置了一个TCP客户端。看起来像这样

@Bean
公共TcpSendingMessageHandler tcpClient()
{
返回Tcp
.outboundAdapter(
nioClient(“localhost”,9060)
.deserializer(新的ByteArrayLfSerializer())
.soKeepAlive(错误)
.leaveOpen(假)
.taskExecutor(Executors.newSingleThreadExecutor())
.clientMode(错误)
.get();
}

或者将工厂定义移动到顶级
@Bean

谢谢您的快速帮助。我现在就去试试。另一个快速问题:在这个用例中使用
clientMode
是否有好处?您提供的配置以某种方式导致了相同的警告,但将ConnectionFactory移动到顶级
@Bean
为我修复了它。不要在注释中问补充问题;在这里使用客户端模式是不常见的。