Uploaded image for project: 'Apache NiFi'
  1. Apache NiFi
  2. NIFI-5196

AbstractJMSProcessor can leave connection hanging open

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • 1.6.0
    • 1.8.0
    • Extensions

    Description

      ConsumeJMS and PublishJMS are based on AbstractJMSProcessor.  They can cause a connection to the MQ Server to be opened and not be closed until the NiFi server is rebooted.

      This can create a problem for an MQ when the initial setup entered is wrong for an IBM MQ system that only allows one connection per user.  Subsequent connections are blocked as the first remains open.  Another potential problem even if the subsequent connection works is the original connection is still open and taking up resources.

      A simple change to the AbstractJMSProcessor would be in the onTrigger() function:

       

      @Override
      public void onTrigger(ProcessContext context, ProcessSession session) throws ProcessException {
          T worker = workerPool.poll();
          if (worker == null) {
              worker = buildTargetResource(context);
          }
      
          boolean offered = false;
          try {
              rendezvousWithJms(context, session, worker);
              offered = workerPool.offer(worker);
          }
          finally {
              if (!offered) {
                  worker.shutdown();
              }
          }
      }

       

      Attachments

        Issue Links

          Activity

            People

              mosermw Michael W Moser
              mystafer Nick Coleman
              Votes:
              0 Vote for this issue
              Watchers:
              5 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: