Return-Path: Delivered-To: apmail-camel-dev-archive@www.apache.org Received: (qmail 28802 invoked from network); 24 Sep 2009 09:40:16 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 24 Sep 2009 09:40:16 -0000 Received: (qmail 44153 invoked by uid 500); 24 Sep 2009 09:40:16 -0000 Delivered-To: apmail-camel-dev-archive@camel.apache.org Received: (qmail 44099 invoked by uid 500); 24 Sep 2009 09:40:15 -0000 Mailing-List: contact dev-help@camel.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@camel.apache.org Delivered-To: mailing list dev@camel.apache.org Received: (qmail 44086 invoked by uid 500); 24 Sep 2009 09:40:15 -0000 Delivered-To: apmail-activemq-camel-dev@activemq.apache.org Received: (qmail 44083 invoked by uid 99); 24 Sep 2009 09:40:15 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 24 Sep 2009 09:40:15 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.140] (HELO brutus.apache.org) (140.211.11.140) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 24 Sep 2009 09:40:12 +0000 Received: from brutus (localhost [127.0.0.1]) by brutus.apache.org (Postfix) with ESMTP id F0E16234C004 for ; Thu, 24 Sep 2009 02:39:51 -0700 (PDT) Message-ID: <1391304423.1253785191968.JavaMail.jira@brutus> Date: Thu, 24 Sep 2009 02:39:51 -0700 (PDT) From: "Claus Ibsen (JIRA)" To: camel-dev@activemq.apache.org Subject: [jira] Updated: (CAMEL-1930) Synchronized access to XPathExpression resulting in contention for multiple consumers In-Reply-To: <2080826390.1251105350107.JavaMail.jira@brutus> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: ae95407df07c98740808b2ef9da0087c X-Virus-Checked: Checked by ClamAV on apache.org [ https://issues.apache.org/activemq/browse/CAMEL-1930?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Claus Ibsen updated CAMEL-1930: ------------------------------- Attachment: camel_1930.patch That was a fast reply. So I am attaching my current patch. It does still need more extensive unit testing but it does seem at first glance to work with concurrent evaluation. Yet again if you or other have more advanced xml documentations and xpath expressions to use for testing that would be appreciated. As the one in this test is simple and thus fast for the computer to evaluate at runtime. > Synchronized access to XPathExpression resulting in contention for multiple consumers > ------------------------------------------------------------------------------------- > > Key: CAMEL-1930 > URL: https://issues.apache.org/activemq/browse/CAMEL-1930 > Project: Apache Camel > Issue Type: Bug > Components: camel-core > Affects Versions: 2.0-M3 > Environment: Java 1.6, Spring 2.5.6 > Reporter: Fabrice Delaporte > Assignee: Claus Ibsen > Fix For: 2.1.0 > > Attachments: camel_1930.patch > > > Hi, > I'm using Camel to do some JMS message routing. Messages are XML so xpath is a natural choice. > However when using a choice with an xpath expression, the XPathBuilder creates one XPathExpression object. According to the specification, these objects are not thread safe so synchronizing looks natural. But then, using multiple jms consumers is totally useless since no concurrent evaluations can be made. > XPathExpression objects would rather need to be stored in a ThreadLocal to avoid synchronization and contention. > Cheers, > Fabrice -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online.