SDK
SDK Java v2.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.

publishMessage #

Publish a real-time message.


publishMessage(Document, [options], [callback]) #

ArgumentsTypeDescription
DocumentobjectDocument object
optionsJSON ObjectOptional parameters
callbackfunctionOptional callback

publishMessage(content, [options], [callback]) #

ArgumentsTypeDescription
contentJSON ObjectContent of the document to publish
optionsJSON ObjectOptional parameters
callbackfunctionOptional callback

Options #

OptionTypeDescriptionDefault
volatileJSON ObjectAdditional information passed to notifications to other usersnull
queuablebooleanMake this request queuable or nottrue

Return Value #

Returns the Collection object to allow chaining.


Callback Response #

Returns a raw Kuzzle response in JSON format.

Usage #

JSONObject message = new JSONObject().put("some", "content");
JSONObject volatile = new JSONObject().put("volatile", "are volatile information");
Options opts = new Options().setVolatile(volatile);
kuzzle
  .collection("collection", "index")
  .publishMessage(message, opts);