Skip to content

Commit

Permalink
Fix example websocket endpoint
Browse files Browse the repository at this point in the history
1. Fixed an issue in synapse config
2. Add additional details in command execution as windows has different syntax
  • Loading branch information
DMadhuranga committed Apr 6, 2020
1 parent d8241cc commit 55fd362
Showing 1 changed file with 15 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -43,16 +43,14 @@ Create the sequence for client to backend mediation, sequence for the backend to

```xml tab='Sequence (Backend Mediation)'
<sequence name="dispatchSeq" xmlns="http://ws.apache.org/ns/synapse">
<in>
<property name="OUT_ONLY" value="true"/>
<property name="FORCE_SC_ACCEPTED" scope="axis2" type="STRING" value="true"/>
<property name="websocket.accept.contenType" scope="axis2" value="application/json"/>
<send>
<endpoint>
<address uri="ws://localhost:8082/websocket"/>
</endpoint>
</send>
</in>
<property name="OUT_ONLY" value="true"/>
<property name="FORCE_SC_ACCEPTED" scope="axis2" type="STRING" value="true"/>
<property name="websocket.accept.contenType" scope="axis2" value="application/json"/>
<send>
<endpoint>
<address uri="ws://localhost:8082/websocket"/>
</endpoint>
</send>
</sequence>
```

Expand Down Expand Up @@ -98,9 +96,15 @@ Starting the Websocket client:

- Download the netty artifacts zip file from [here](https://github.com/wso2-docs/ESB) and extract it. The extracted folder will be shown as `ESB-master`.
- Open a terminal, navigate to `ESB-master/ESB-Artifacts/Netty_artifacts_for_WebSocket_samples` and execute the following command to start the WebSocket server on port 8082:
```bash

If you are using Linux/MacOs, execute the following command:
```bash
java -cp netty-example-4.0.30.Final.jar:lib/*:. io.netty.example.http.websocketx.server.WebSocketServer
```
If you are using Windows, execute the following command:
```bash
java -cp netty-example-4.0.30.Final.jar;lib/*;. io.netty.example.http.websocketx.server.WebSocketServer
```

If you analyze the log, you will see that an HTTP request is sent to the
Websocket server, and that the Websocket server injects the response to
Expand Down

0 comments on commit 55fd362

Please sign in to comment.