Uploaded image for project: 'logback'
  1. logback
  2. LOGBACK-1110

JMSTopicAppender and JMSQueueAppender may cause ActiveMQ connection leak

    XMLWordPrintable

Details

    Description

      When a JMS appender is stopping, it only closes its JMS connection if started equals true. See link below
      https://github.com/qos-ch/logback/blob/master/logback-classic/src/main/java/ch/qos/logback/classic/net/JMSTopicAppender.java#L140
      https://github.com/qos-ch/logback/blob/master/logback-classic/src/main/java/ch/qos/logback/classic/net/JMSQueueAppender.java#L140

      However, in the appender start method, if anything goes wrong after the JMS connection is created (in my case, failed to lookup a topic from JNDI), then the appender, which already has a JMS connection, will not be started. When the appender stops, the JMS connection will not be closed.

      A JMS connection, once created, even if not started, may have resources (e.g. thread, thread pool, socket connection) allocated to it. Therefore, if not closed correctly, will cause resource leak.

      Attachments

        Activity

          People

            logback-dev Logback dev list
            rdchris2911 Wei Cai
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated: