Usage - 6.3

Talend ESB Mediation Developer Guide

Talend Data Fabric
Talend Data Services Platform
Talend ESB
Talend MDM Platform
Talend Open Studio for ESB
Talend Real-Time Big Data Platform
Design and Development
Talend ESB

In this example we let Camel exposes a websocket server which clients can communicate with. The websocket server uses the default host and port, which would be

The example will send back an echo of the input. To send back a message, we need to send the transformed message to the same endpoint "websocket://echo". This is needed

because by default the messaging is InOnly.

// expose a echo websocket client, that sends back an echo
    .log(">>> Message received from WebSocket Client : ${body}")
    // send back to the client, by sending the message to the same endpoint
    // this is needed as by default messages is InOnly
    // and we will by default send back to the current client using the provided 
    connection key

This example is part of an unit test, which you can find here. As a client we use the AHC library which offers support for web socket as well.

Here is another example where webapp resources location have been defined to allow the Jetty Application Server to not only register the WebSocket servlet but also to expose web resources for the browser. Resources should be defined under the webapp directory.