unsubscribe

Removes a subscription.

Arguments

Copied to clipboard!
void unsubscribe(String roomId)
void unsubscribe(String roomId, io.kuzzle.sdk.QueryOptions options)

Arguments Type Description
roomId
String
Subscription room ID
options
io.kuzzle.sdk.QueryOptions
Query options

options

Additional query options

Option Type
(default)
Description
queuable
boolean

(true)
Make this request queuable or not

Exceptions

Throws a io.kuzzle.sdk.KuzzleException if there is an error. See how to handle error.

Usage

Copied to clipboard!
NotificationListener listener = new NotificationListener() {
  public void onMessage(NotificationResult notification) {}
};

try {
  String roomId = kuzzle.getRealtime().subscribe(
    "nyc-open-data", 
    "yellow-taxi", 
    "{}", 
    listener
  );

  kuzzle.getRealtime().unsubscribe(roomId);

  System.out.println("Success");
} catch (KuzzleException e) {
  System.err.println(e.getMessage());
}