Return-Path: Delivered-To: apmail-activemq-users-archive@www.apache.org Received: (qmail 3815 invoked from network); 4 Sep 2007 15:10:09 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 4 Sep 2007 15:10:09 -0000 Received: (qmail 74600 invoked by uid 500); 4 Sep 2007 15:10:00 -0000 Delivered-To: apmail-activemq-users-archive@activemq.apache.org Received: (qmail 74579 invoked by uid 500); 4 Sep 2007 15:10:00 -0000 Mailing-List: contact users-help@activemq.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: users@activemq.apache.org Delivered-To: mailing list users@activemq.apache.org Received: (qmail 74564 invoked by uid 99); 4 Sep 2007 15:10:00 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 04 Sep 2007 08:10:00 -0700 X-ASF-Spam-Status: No, hits=2.6 required=10.0 tests=DNS_FROM_OPENWHOIS,SPF_HELO_PASS,SPF_PASS,WHOIS_MYPRIVREG X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of lists@nabble.com designates 216.139.236.158 as permitted sender) Received: from [216.139.236.158] (HELO kuber.nabble.com) (216.139.236.158) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 04 Sep 2007 15:11:09 +0000 Received: from isper.nabble.com ([192.168.236.156]) by kuber.nabble.com with esmtp (Exim 4.63) (envelope-from ) id 1ISa21-0003m0-RU for users@activemq.apache.org; Tue, 04 Sep 2007 08:09:33 -0700 Message-ID: <12480020.post@talk.nabble.com> Date: Tue, 4 Sep 2007 08:09:33 -0700 (PDT) From: corcorda To: users@activemq.apache.org Subject: Re: Blocking transactions In-Reply-To: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Nabble-From: dave.corcoran@gmail.com References: <12479372.post@talk.nabble.com> X-Virus-Checked: Checked by ClamAV on apache.org It's not the default prefetch values because I can recreate the problem with just 2 consumers and a few jobs. I think the problem must be with the way I'm using sessions. I haven't used JMS before so I'm following the samples and maybe they're too simple. The code is very simple. Create a connection using the ActiveMQConnectionFactory, call createSession with true and -1 as params. Then using this session create a producer that writes jobs and commits. On each consumer I do the exact same thing, except I create a consumer and call commit after the processing. They run in different VMs. What do you mean "Each consumer should be in its own session"? This sounds like where I'm going wrong ;) James.Strachan wrote: > > On 9/4/07, corcorda wrote: >> >> I'm having some trouble with transactions. The problem is multiple >> consumers >> block each other if they spend a long time in a transaction. > > Each consumer should be in its own session to avoid them blocking each > other right? > > >> What I'm looking to do is send several hundred jobs into a queue. Each >> job >> takes somewhere between a few seconds and 30 minutes to run. Each >> consumer >> reads a job from the queue, processes it, writes the result back to the >> queue then commits the transactions. If any problems happen in between it >> should rollback and someone else should try the job. Each consumer runs >> in >> it's own VM. It doesn't matter what order the jobs are processed in. >> >> The problem is if one consumer receives a message and starts to process >> it >> all the other consumer block on the receive call until the first one has >> done a commit or rollback. This happens even though there are plenty of >> messages in the queue. Is there a way around this? > > Am thinking you're just hitting the default prefetch values... > http://activemq.apache.org/what-is-the-prefetch-limit-for.html > > -- > James > ------- > http://macstrac.blogspot.com/ > > -- View this message in context: http://www.nabble.com/Blocking-transactions-tf4378065s2354.html#a12480020 Sent from the ActiveMQ - User mailing list archive at Nabble.com.