224.5. 带有 sync=false 的示例
在本例中,Camel 公开服务,侦听端口 6200 上的 TCP 连接。我们使用 文本代码。在我们的路由中,我们创建一个侦听端口 6200 的 Mina consumer 端点:
from("mina2:tcp://localhost:" + port1 + "?textline=true&sync=false").to("mock:result");由于示例是单元测试的一部分,我们可以通过在端口 6200 上向其发送一些数据来测试。
MockEndpoint mock = getMockEndpoint("mock:result");
mock.expectedBodiesReceived("Hello World");
template.sendBody("mina2:tcp://localhost:" + port1 + "?textline=true&sync=false", "Hello World");
assertMockEndpointsSatisfied();