public void disconnectFromBroker(final MqttAsyncConnection connection){
  try {
    connection.disconnect(new MqttDisconnectionResultHandler());
  }
 catch (  SpyException e) {
    Platform.runLater(new MqttEventHandler(new MqttDisconnectionAttemptFailureEvent(connection,e)));
    logger.error(e.getMessage(),e);
  }
}

public void disconnectFromBroker ( final MqttAsyncConnection connection ) { try { connection . disconnect ( new MqttDisconnectionResultHandler ( ) ) ; } catch ( SpyException e ) { Platform . runLater ( new MqttEventHandler ( new MqttDisconnectionAttemptFailureEvent ( connection , e ) ) ) ; logger . error ( e . getMessage ( ) , e ) ; } }
disconnects the specified connection from the broker .
