【问题标题】:no response from TCP socket in Apache Camel using Netty4使用 Netty4 的 Apache Camel 中的 TCP 套接字没有响应
【发布时间】:2018-04-19 02:21:19
【问题描述】:

这是我的路线

from(Endpoints.login.inRoute())
    .process(new LoginRequestProcessor())
    .to("netty4:tcp://somehost:9001?textline=true")
    .process(new LoginResponseProcessor())
    .to(Endpoints.login.outRoute());

我只想与运行在 somehost 端口 9001 的套接字服务器通信,但没有得到任何响应。

但是,我使用 telnet 测试了套接字服务器,它是活动的并且有响应。

此外,我使用 C 编写了一个简单的 TCP 套接字服务器,并测试了完全相同的 Camel 路由,但使用了我的本地服务器 (localhost) 的地址及其本地端口,一切正常。

会发生什么?

谢谢!

【问题讨论】:

  • 试过设置sync=true吗?
  • 你有日志吗?

标签: java sockets tcp apache-camel netty


【解决方案1】:

尝试传递参数 synchronous=true,它会强制你的调用是同步的。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2016-02-26
    • 1970-01-01
    • 1970-01-01
    • 2020-05-04
    • 2019-01-28
    相关资源
    最近更新 更多