Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id C50E32009F3 for ; Thu, 5 May 2016 21:02:14 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id C3C3F160A04; Thu, 5 May 2016 19:02:14 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id 2C2F4160A05 for ; Thu, 5 May 2016 21:02:14 +0200 (CEST) Received: (qmail 46315 invoked by uid 500); 5 May 2016 19:02:13 -0000 Mailing-List: contact issues-help@cxf.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@cxf.apache.org Delivered-To: mailing list issues@cxf.apache.org Received: (qmail 46128 invoked by uid 99); 5 May 2016 19:02:13 -0000 Received: from arcas.apache.org (HELO arcas) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 05 May 2016 19:02:13 +0000 Received: from arcas.apache.org (localhost [127.0.0.1]) by arcas (Postfix) with ESMTP id 1A6892C1F70 for ; Thu, 5 May 2016 19:02:13 +0000 (UTC) Date: Thu, 5 May 2016 19:02:13 +0000 (UTC) From: "ASF GitHub Bot (JIRA)" To: issues@cxf.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Commented] (CXF-6454) Orphaned JMS connections created in endless loop MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 archived-at: Thu, 05 May 2016 19:02:14 -0000 [ https://issues.apache.org/jira/browse/CXF-6454?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15272863#comment-15272863 ] ASF GitHub Bot commented on CXF-6454: ------------------------------------- Github user dhpatel27 commented on the pull request: https://github.com/apache/cxf/pull/132#issuecomment-217244517 We are hitting critical issues due to this bug in our applications > Orphaned JMS connections created in endless loop > ------------------------------------------------ > > Key: CXF-6454 > URL: https://issues.apache.org/jira/browse/CXF-6454 > Project: CXF > Issue Type: Bug > Components: JMS, Transports > Affects Versions: 3.0.5 > Reporter: Waldemar Szostak > Assignee: Christian Schneider > Priority: Critical > Fix For: 3.0.7, 3.1.7, 3.2.0 > > > h3. Problem description > In JMSFactory.createConnection(JMSConfiguration): > {code}public static Connection createConnection(JMSConfiguration jmsConfig) throws JMSException { > String username = jmsConfig.getUserName(); > ConnectionFactory cf = jmsConfig.getConnectionFactory(); > Connection connection = username != null > ? cf.createConnection(username, jmsConfig.getPassword()) > : cf.createConnection(); > if (jmsConfig.getDurableSubscriptionClientId() != null) { > connection.setClientID(jmsConfig.getDurableSubscriptionClientId()); > } > return connection; > }{code} > there is no exception handling if the clientID fails to be set. Such an exception would exit this method without passing the reference to the just-opened JMS connection to exception handling code (JMSDestination.createTargetDestinationListener()). > Moreover, JMSDestination.restartConnection() keeps on starting new connections (there is no max attempt restriction!) until it creates one without an exception thrown in the process. > Now, if the clientID is already connected to the ESB, this creation of new connection will last until server resources are no longer available to the JVM. > h3. Possible solution > # Close the connection if it's not possible to set the specified clientID at the time: > {code}public static Connection createConnection(JMSConfiguration jmsConfig) throws JMSException { > String username = jmsConfig.getUserName(); > ConnectionFactory cf = jmsConfig.getConnectionFactory(); > Connection connection = username != null > ? cf.createConnection(username, jmsConfig.getPassword()) > : cf.createConnection(); > if (jmsConfig.getDurableSubscriptionClientId() != null) { > try { connection.setClientID(jmsConfig.getDurableSubscriptionClientId()); > } catch (InvalidClientIDException e) { > connection.close(); > throw e; > } > } > return connection; > }{code} > # Add a setting to restrict the maximum attempts to restart the connection in JMSDestination.restartConnection() A configurable value would be best, but even a hardcoded.. anything but the practically endless loop ;-) -- This message was sent by Atlassian JIRA (v6.3.4#6332)