SDK
SDK Java v1.x
1

You are currently looking at the documentation of a previous version of Kuzzle. We strongly recommend that you use the latest version. You can also use the version selector in the top menu.

This SDK has been deprecated because of stability issues. It is not advised to use it in a production environment.

Constructor #

This is the main entry point to communicate with Kuzzle.
Each instance represent a connection to Kuzzle with specific options.

Signature #

Copied to clipboard!
Kuzzle(String host)
Kuzzle(String host, io.kuzzle.sdk.Options options)

Arguments #

Argument Type Description Required
host String The target Kuzzle host yes
options io.kuzzle.sdk.Options Kuzzle connection configuration yes

host #

The Kuzzle host to connect to.
Can be a hostname or an IP address.

options #

Option Type Description Default Required
autoQueue boolean Automatically queue all requests during offline mode false no
autoReconnect boolean Automatically reconnect after a connection loss true no
autoReplay boolean Automatically replay queued requests on a reconnected event false no
autoResubscribe boolean Automatically renew all subscriptions on a reconnected event true no
offlineMode Mode Offline mode configuration. MANUAL or AUTO MANUAL no
queueTTL int Time a queued request is kept during offline mode, in milliseconds 120000 no
queueMaxSize int Number of maximum requests kept during offline mode 500 no
replayInterval Duration Delay between each replayed requests, in milliseconds 10 no
reconnectionDelay Duration number of milliseconds between reconnection attempts 1000 no
sslConnection boolean Switch Kuzzle connection to SSL mode false no
volatile VolatileData Common volatile data, will be sent to all future requests - no

Notes:

  • if queueTTL is set to 0, requests are kept indefinitely
  • The offline buffer acts like a first-in first-out (FIFO) queue, meaning that if the queueMaxSize limit is reached, older requests are discarded to make room for new requests
  • if queueMaxSize is set to 0, an unlimited number of requests is kept until the buffer is flushed
  • multiple methods allow passing specific volatile data. These volatile data will be merged with the global Kuzzle volatile object when sending the request, with the request specific volatile taking priority over the global ones.

Getter & Setter #

The properties can be writable.
For example, you can read the volatile property via getVolatile() and set it via setVolatile().

Property name Type Description Availability
autoReplay boolean Automatically replay queued requests on a reconnected event Set
jwt String Token used in requests for authentication. Get
volatile String Common volatile data in JSON format, will be sent to all future requests Get/Set

Return #

A io.kuzzle.sdk.Kuzzle instance.

Usage #

Copied to clipboard!
Options options = new Options();
options.setAutoResubscribe(false);
WebSocket ws = new WebSocket("kuzzle");
Kuzzle kuzzle = new Kuzzle(ws, options);