code: @SuppressWarnings("unused")
      public void destroy() {
          // stop all workers
          for (KafkaMsgConsumerWorker worker : topicWorkers.values()) {
              try {
                  worker.stopWorker();
              } catch (Exception e) {
                  LOGGER.warn(e.getMessage(), e);
              }
          }
          topicWorkers.clear();
  
          // clear all message listeners
          synchronized (topicMsgListeners) {
              topicMsgListeners.clear();
          }
  
          // close all KafkaConsumer
          for (KafkaConsumer<String, byte[]> consumer : topicConsumers.values()) {
              synchronized (consumer) {
                  try {
                      consumer.close();
                  } catch (WakeupException e) {
                  } catch (Exception e) {
                      LOGGER.warn(e.getMessage(), e);
                  }
              }
          }
          topicConsumers.clear();
  
          if (executorService != null && myOwnExecutorService) {
              try {
                  List<Runnable> tasks = executorService.shutdownNow();
              } catch (Exception e) {
                  LOGGER.warn(e.getMessage(), e);
              } finally {
                  executorService = null;
              }
          }
      }
docs: Destroying method.