Sample with Spring DSL - 6.3

Talend ESB Mediation Developer Guide

EnrichVersion
6.3
EnrichProdName
Talend Data Fabric
Talend Data Services Platform
Talend ESB
Talend MDM Platform
Talend Open Studio for ESB
Talend Real-Time Big Data Platform
task
Design and Development
EnrichPlatform
Talend ESB

Spring DSL can, of course, also be used for Mina. In the sample below we expose a TCP server on port 5555:

<route>
   <from uri="mina2:tcp://localhost:5555?textline=true"/>
   <to uri="bean:myTCPOrderHandler"/>
</route>

In the route above, we expose a TCP server on port 5555 using the textline codec. We let the Spring bean with ID, myTCPOrderHandler, handle the request and return a reply. For instance, the handler bean could be implemented as follows:

public String handleOrder(String payload) {
     ...
     return "Order: OK"
}