0

我有一个在远程主机上运行的程序,我需要连接、握手,然后收听消息。我已经设置了以下骆驼路线:

<route>
   <from uri="netty:tcp://localhost:50001?decoders=#decoders&amp;sync=false" />
   <bean ref="TransformMessage" method="inboundDecoder" />
   <to uri="eventadmin:messages/aacus/inbound" />
</route>

<route>
   <from uri="eventadmin:messages/aacus/outbound" />
   <bean ref="TransformMessage" method="outboundEncoder" />
   <to uri="netty:tcp://192.168.0.111:50001?allowDefaultCodec=false&amp;sync=false" />
</route>

我的问题是如何使这项工作?如果我使用

<from uri="netty:tcp://192.168.0.111:50001?decoders=#decoders&amp;sync=false" />

它因绑定错误而失败。

如何在不修改服务器的情况下设置连接以响应特定端口?

4

2 回答 2

1

在撰写本文时,camel-mina 和 camel-netty 都无法做到这一点。消费者只能绑定到本地服务器。Apache 有一张 JIRA 票,可以在未来实现这样的新功能。https://issues.apache.org/jira/browse/CAMEL-1077

于 2011-08-19T06:43:41.630 回答
0

使用以下解决方法:

而是192.168.0.111使用localhost. 然后安装“socat”并按如下方式启动

socat -s -u tcp4:192.168.0.111:50001 tcp4:localhost:50001

这会将您的远程连接隧道连接到您使用 camel/netty 创建的本地服务。

于 2013-09-26T18:30:27.800 回答