【发布时间】:2016-03-20 23:39:39
【问题描述】:
开始于:
http://www.typesafe.com/activator/template/camel-http
我做了一个简单的路线:
import org.apache.camel.scala.dsl.builder.RouteBuilder
class SocketPost extends RouteBuilder {
"""netty:tcp://localhost:12000""" ==> {
id("hello socket")
log("hello")
to("http4:localhost:9000/")
}
}
并添加它:
context.setUseMDCLogging(true)
context.addRoutes(new SocketPost())
context.start()
我可以远程登录到 localhost:12000 并输入一些数据并断开连接,但是我的谷歌技能使我无法处理这些数据。我只有在连接时才会收到日志:
09:48:43 DEBUG org.apache.camel.component.netty.DefaultServerPipelineFactory Using OrderedMemoryAwareThreadPoolExecutor with core pool size: 16
否则一切都是沉默的。我希望通过 telnet 输入的数据像教程中一样发布到 localhost:9000。
【问题讨论】:
-
在 netty uri 中设置 textline=true,以基于文本。阅读更多关于 netty 文档:camel.apache.org/netty
-
成功了,谢谢!如果您发布 """netty:tcp://localhost:12000?textline=true""" 我可以选择它作为答案
标签: scala apache-camel netty telnet