code: private void closeRemainingProducers()
      {
          List<AbstractMessageProducer> producersToClose = new ArrayList<>(producersMap.size());
          synchronized (producersMap)
          {
              producersToClose.addAll(producersMap.values());
          }
          for (int n = 0 ; n < producersToClose.size() ; n++)
          {
              MessageProducer producer = producersToClose.get(n);
              log.debug("Auto-closing unclosed producer : "+producer);
              try
              {
                  producer.close();
              }
              catch (Exception e)
              {
                  log.error("Could not close producer "+producer,e);
              }
          }
      }
docs: Close remaining consumers