WebSocket

WebSocket

This connector enable communication via WebSocket Protocol.

Allows to send data to the OpenGate platform and receive operations from it.

Dependencies

This module requires the following modules:

  • Core commons: Provides many interfaces that this module will use
  • Device Info Provider: Needed to know the Device Id of the device that are running the Agent and the API Key to access to OpenGate. Both data are required to achieve a connection with OpenGate and transferred data will have the deviceId in its metadata.
  • Dispatcher: Needed to process the payloads and de/serialize its content.

Configuration

To configure WebSocket connector, a file named es.amplia.oda.connector.websocket.cfg must be created with the next parameters:

  • host: Required parameter. Specify the direction of the third system the connector have to send the data. ’localhost’ is a good host to do tests with.
  • port: 80 by default. Port though the connector have to connect to the host.
  • path: Required parameter. The general path of the route used to create the connection with third system.
  • connectionTimeout: 30 by default. Time in seconds that the client created by the connector will wait to throw a timeout.
  • keepAliveInterval: 180 by default. Time in seconds that the client created by the connector will send a KeepAlive message to notify to the WebSocket server.

In other words, es.amplia.oda.connector.websocket.cfg will have the content:

host=localhost
port=80
path=commonPathToAllSites
connectionTimeout=30
keepAliveInterval=180

And can run with the following minimal content:

host=localhost
generalPath=commonPathToAllSites

Source Code

You can check the source code here