code: private void closeRemainingConsumers()
      {
          List<AbstractMessageConsumer> consumersToClose = new ArrayList<>(consumersMap.size());
          synchronized (consumersMap)
          {
              consumersToClose.addAll(consumersMap.values());
          }
          for (int n = 0 ; n < consumersToClose.size() ; n++)
          {
              MessageConsumer consumer = consumersToClose.get(n);
              log.debug("Auto-closing unclosed consumer : "+consumer);
              try
              {
                  consumer.close();
              }
              catch (Exception e)
              {
                  log.error("Could not close consumer "+consumer,e);
              }
          }
      }
docs: Close remaining consumers