Sample with sync=false

Talend ESB Mediation Developer Guide

EnrichVersion
6.2
EnrichProdName
Talend ESB
task
Design and Development
Installation and Upgrade
EnrichPlatform
Talend ESB

In this sample, Camel exposes a service that listens for TCP connections on port 6200. We use the textline codec. In our route, we create a Mina consumer endpoint that listens on port 6200:

from("mina2:tcp://localhost:" + port1 + "?textline=true&sync=false")
   .to("mock:result");

As the sample is part of a unit test, we test it by sending some data to it on port 6200.

MockEndpoint mock = getMockEndpoint("mock:result");
mock.expectedBodiesReceived("Hello World");
  
template.sendBody("mina2:tcp://localhost:" + port1 + "?textline=true&sync=false", 
"Hello World");
  
assertMockEndpointsSatisfied();