Procedure
-
Double-click the testMina component to open its Basic settings view in the Component tab.
-
In the URI field, enter the code
"timer:testOneWayMina?delay=1000&period=2000"
to define a timer for starting message exchanges. In this use case, we want each message to be delivered after a 1-second delay at a period of 2 seconds. -
Double-click the initializeRequest component to open its Basic settings view in the Component tab.
-
Select Constant from the Language list box and type in
"test message\n"
in the Expression field. -
Double-click the logRequest component to open its Basic settings view in the Component tab.
-
In the URI field, enter
"log:jobSocketIn"
where the incoming message exchanges are logged. -
Double-click the jobSocketIn component and click Advanced settings view in the Component tab.
-
In this use case, we will use the Camel component camel-mina as the transport. To use this component, click
at the bottom of the Dependencies list to add a row and select
mina
from the drop-down list. For more information about Mina, see the site http://camel.apache.org/mina.html.Alternatively, you can use a cConfig component and add the library of MINA to the Dependencies list of the cConfig component. To do so, clickat the bottom of the Dependencies list to add a row. Select this row and click the [...] button at the end to show the Select Module wizard.
Selectcamel-mina-alldep-2.9.2.jar
from the inner modules and click OK to add it to the Dependencies list. -
Click the Basic settings view in the Component tab of the jobSocketIn component. In the URI field, enter
"mina:tcp://localhost:" + 8900 + "?textline=true&sync=false"
to send the message to the Mina endpoint of a TCP service on port 8900 as a text line in the InOnly mode.