Return-Path: Delivered-To: apmail-camel-users-archive@www.apache.org Received: (qmail 47410 invoked from network); 1 Dec 2009 05:27:47 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 1 Dec 2009 05:27:47 -0000 Received: (qmail 89755 invoked by uid 500); 1 Dec 2009 05:27:46 -0000 Delivered-To: apmail-camel-users-archive@camel.apache.org Received: (qmail 89668 invoked by uid 500); 1 Dec 2009 05:27:45 -0000 Mailing-List: contact users-help@camel.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: users@camel.apache.org Delivered-To: mailing list users@camel.apache.org Received: (qmail 89654 invoked by uid 99); 1 Dec 2009 05:27:44 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 01 Dec 2009 05:27:44 +0000 X-ASF-Spam-Status: No, hits=-0.0 required=10.0 tests=SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of claus.ibsen@gmail.com designates 209.85.218.211 as permitted sender) Received: from [209.85.218.211] (HELO mail-bw0-f211.google.com) (209.85.218.211) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 01 Dec 2009 05:27:33 +0000 Received: by bwz3 with SMTP id 3so3747826bwz.36 for ; Mon, 30 Nov 2009 21:27:13 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :from:date:message-id:subject:to:content-type :content-transfer-encoding; bh=jnNJ7XkPyp3ALxJuPyD/ignKR29zXI8ynoYt2Hr5nAM=; b=YqciVL2Oq0oeOniu3KIZAALDpzbvbkR5aDWpbqFfmrs3aZabLFPPXjchnFoUFK8B8h uHbNmDqzce40QJaVcy/2MJUNbiSPUPcHOh6CLJ7RsF3HPj7LBPEIcjpvxehy+t5agRgz DbjN6NlG4voT8+geWZ/A4gBA0837GRWNYqvSg= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :content-type:content-transfer-encoding; b=cmyRRR7gviGiXSbnEHR0NWRCdJd5jQQS/SUK4H2I9Z6F9uYDKTevtaJ/2c0uBljoI/ cxSl4xHtK/zau82LhjCYYq8+vhQP2atk42cIle3UtmSQjNxwmzxVY8VnatfETPLqmCyE ENO9Km1Kk+K11NquKX8TzzSrP3zdPOX2UeDoY= MIME-Version: 1.0 Received: by 10.204.34.13 with SMTP id j13mr549373bkd.32.1259645233145; Mon, 30 Nov 2009 21:27:13 -0800 (PST) In-Reply-To: <26582486.post@talk.nabble.com> References: <26582427.post@talk.nabble.com> <26582486.post@talk.nabble.com> From: Claus Ibsen Date: Tue, 1 Dec 2009 06:26:53 +0100 Message-ID: <5380c69c0911302126i17ea7fedpdfb77f8eb9dd66a9@mail.gmail.com> Subject: Re: concurrentconsumers thread safe? To: users@camel.apache.org Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-Virus-Checked: Checked by ClamAV on apache.org Its all about how you have implemented your asyncMDPCallback bean. You can implemented it badly so its not threadsafe. And you can implemented it correct so its threadsafe. The Camel pieces are threadsafe and supports concurrency out of the box. A rule of thumb in your bean is to not have any state, e.g. dont have any class fields in your bean. On Mon, Nov 30, 2009 at 10:44 PM, skt99 wrote: > > It appears my configuration did not get copied properly..I am sending it > again...thanks. > > =A0 > =A0 =A0 =A0 =A0 > =A0 =A0 =A0 =A0 =A0 =A0 > =A0 =A0 =A0 =A0 =A0 =A0 > =A0 =A0 =A0 =A0 > =A0 =A0 > > =A0 > class=3D"org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor= "> > =A0 =A0 =A0 =A0 > =A0 =A0 =A0 =A0 > =A0 =A0 =A0 =A0 > > > =A0 class=3D"org.apache.camel.component.jms.JmsConfiguration"> > =A0 =A0 =A0 =A0 ref=3D"jcaPooledConnectionFactory"/> > =A0 =A0 =A0 =A0 > =A0 =A0 =A0 =A0 > =A0 =A0 =A0 =A0 > =A0 =A0 =A0 =A0 > =A0 =A0 =A0 =A0 > =A0 =A0 > > =A0 class=3D"org.apache.activemq.camel.component.ActiveMQComponent"> > =A0 =A0 =A0 =A0 > =A0 > > Appreciate any help. > > > skt99 wrote: >> >> Hi, >> =A0 =A0I have this configuration - The Spring context is loaded only onc= e on >> app startup. An MDP asyncMDPCallback configured as a singleton using >> Spring, is setup to consume messages. >> >> =A0 >> =A0 =A0 =A0 =A0 >> =A0 =A0 =A0 =A0 =A0 =A0 >> =A0 =A0 =A0 =A0 =A0 =A0 >> =A0 =A0 =A0 =A0 >> =A0 =A0 >> >> =A0> class=3D"org.springframework.scheduling.concurrent.ThreadPoolTaskExecuto= r"> >> =A0 =A0 =A0 =A0 >> =A0 =A0 =A0 =A0 >> =A0 =A0 =A0 =A0 >> >> >> =A0> class=3D"org.apache.camel.component.jms.JmsConfiguration"> >> =A0 =A0 =A0 =A0 > ref=3D"jcaPooledConnectionFactory" /> >> =A0 =A0 =A0 =A0 >> =A0 =A0 =A0 =A0 >> =A0 =A0 =A0 =A0 > /> >> =A0 =A0 =A0 =A0 >> =A0 =A0 =A0 =A0 >> =A0 =A0 >> >> =A0> class=3D"org.apache.activemq.camel.component.ActiveMQComponent"> >> =A0 =A0 =A0 =A0 >> =A0 >> >> Is this setup for concurrentConsumers using ThreadPoolTaskExecutor >> thread-safe by default, or do I need to handle it in my app? Appreciate >> any help. >> > > -- > View this message in context: http://old.nabble.com/concurrentconsumers-t= hread-safe--tp26582427p26582486.html > Sent from the Camel - Users mailing list archive at Nabble.com. > > --=20 Claus Ibsen Apache Camel Committer Author of Camel in Action: http://www.manning.com/ibsen/ Open Source Integration: http://fusesource.com Blog: http://davsclaus.blogspot.com/ Twitter: http://twitter.com/davsclaus