There is a race condition with the shutdown of the client. The close method sends the closeBlocking call to the Java layer, which stops the connection. The close method then deletes the client object. There still could be messages being processed by the callbacks, however. Ensure the closeCallback finishes completing before deleting the object to clear out errors that happen most of the time.