code: public void close() throws  IOException {
      try {
        this.running = false;
        this.accumulator.close();
        if (!this.service.awaitTermination(60, TimeUnit.SECONDS)) {
          forceClose();
        } else {
          LOG.info ("Closed properly: elapsed " + (System.currentTimeMillis() - startTime) + " milliseconds");
        }
      } catch (InterruptedException e) {
        LOG.error ("Interruption happened during close " + e.toString());
      } finally {
        this.processor.close();
      }
    }
docs: Close all the resources, this will be blocked until all the request are sent and gets acknowledged