camel-akka和演员的回应

时间:2016-11-07 10:59:24

标签: apache-camel akka netty akka-camel

亲爱的Akka / Camel Masters!

我有以下路线:

(netty4:tcp) - > (阿卡:演员)

我使用akka-camel模块,其中:

akka:actor属于UntypedConsumerActor类型 netty4:tcp是在akka:actor

的getEndopointUri方法中定义的端点
netty4:tcp://localhost:8000?textline=true

当我向tcp套接字发送字节时,我收到异常,告知套接字通道已关闭:

Caused by: java.nio.channels.ClosedChannelException: null
        at io.netty.channel.AbstractChannel$AbstractUnsafe.write(...)(Unknown Source) [netty-all-4.1.4.Final.jar:4.1.4.Final]

Message History
---------------------------------------------------------------------------------------------------------------------------------------
RouteId              ProcessorId          Processor                                                                        Elapsed (ms)
[akka://FileDaemonS] [akka://FileDaemonS] [tcp://localhost:8000                                                          ] [     60061]
[akka://FileDaemonS] [to1               ] [akka://FileDaemonSystem/user/FileDaemonTcpEndpoint?autoAck=false&replyTimeout=] [     60037]
java.util.concurrent.TimeoutException: Failed to get response from the actor [ActorEndpointPath(akka://FileDaemonSystem/user/FileDaemonTcpEndpoint)] within timeout [1 minute]. Check replyTimeout and blocking settings [Endpoint[akka://FileDaemonSystem/user/FileDaemonTcpEndpoint?autoAck=false&replyTimeout=60000+milliseconds]]
        at akka.camel.internal.component.ActorProducer$$anonfun$1.applyOrElse(ActorComponent.scala:151) ~[akka-camel_2.11-2.4.9.jar:na]
        at akka.camel.internal.component.ActorProducer$$anonfun$1.applyOrElse(ActorComponent.scala:148) ~[akka-camel_2.11-2.4.9.jar:na]
        at scala.runtime.AbstractPartialFunction.apply(AbstractPartialFunction.scala:36) ~[scala-library-2.11.8.jar:na]
        at scala.PartialFunction$AndThen.apply(PartialFunction.scala:186) [scala-library-2.11.8.jar:na]
        at scala.concurrent.impl.CallbackRunnable.run(Promise.scala:32) [scala-library-2.11.8.jar:na]

我做错了什么?

1 个答案:

答案 0 :(得分:0)

我找到了解决方案。将netty端点设置为单向可以解决问题。

netty4:tcp://localhost:8000?textline=true&sync=false