Skip to content

Websocket Event processing

Nick Kasprzak edited this page Jun 14, 2019 · 6 revisions

Introduction

This is a guide to how to use iland's Java SDK to connect a websocket for event processing.

To follow along with the Wiki git clone the project and cd into the web-socket-events directory.

Getting a WebSocketClient

Using a websocket is easy with iland's Java SDK as we provide you with the the object WebSocketClient documented here.

After authenticating your API client and getting a company id and org uuid through the user's inventory, explanations for which can be found here and here.

Once we have a company id we can connect our WebSocketClient easily using the following code:

final WebSocketClient webSocketClient = apiClient.getEventWebSocket(COMPANY_ID);

Looking at the documentation for WebSocketClient we can see that we can consume events and tasks.

For this example we will be consuming and processing events.

The first way we will consume events is by

Clone this wiki locally