Return-Path: Delivered-To: apmail-activemq-users-archive@www.apache.org Received: (qmail 70569 invoked from network); 15 May 2008 16:49:39 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 15 May 2008 16:49:39 -0000 Received: (qmail 8300 invoked by uid 500); 15 May 2008 16:49:36 -0000 Delivered-To: apmail-activemq-users-archive@activemq.apache.org Received: (qmail 8284 invoked by uid 500); 15 May 2008 16:49:36 -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 8269 invoked by uid 99); 15 May 2008 16:49:36 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 15 May 2008 09:49:36 -0700 X-ASF-Spam-Status: No, hits=0.2 required=10.0 tests=SPF_PASS,WHOIS_MYPRIVREG X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of chirino@gmail.com designates 64.233.184.232 as permitted sender) Received: from [64.233.184.232] (HELO wr-out-0506.google.com) (64.233.184.232) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 15 May 2008 16:48:39 +0000 Received: by wr-out-0506.google.com with SMTP id 69so225728wri.5 for ; Thu, 15 May 2008 09:49:00 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from:sender:to:subject:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references:x-google-sender-auth; bh=vzJKgWm93ti0n4K3Wdax8xzA3h63AJuHWobxrlWmGxU=; b=GdUKvT1GTBgIgj/CcNx5cLHSHFJWesTmBEvKaMyhl3xK7BrRSSM1PFXxWBIwGvZOzVrqlb/Gb04TfD0FQ7groD/LNMnWbjYbK1AJve2fW0yKCYeyxm5AozzuoDQfH5PrjgKrTVEn4p5S/LTCRXespH6p/GtB/I7kkzrKtfFc0hI= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:sender:to:subject:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references:x-google-sender-auth; b=M4x0KmUo+2FJ6c+Y5SC31fW90Ihd8kHx0XGVsYPu7W3pL07OLNq4zAuFBlHhAqGyYp1GBOZVRwEG9JrEDz99+w9F+6w2XmJ7qLW0INXYyhZi8tMjn71cly7o/t3MLzt/FEbaF8HJ02M0NgYW3FT/aXG9VcNLWorE7JK0emDr/Dg= Received: by 10.114.156.1 with SMTP id d1mr2731690wae.120.1210870139869; Thu, 15 May 2008 09:48:59 -0700 (PDT) Received: by 10.114.160.2 with HTTP; Thu, 15 May 2008 09:48:59 -0700 (PDT) Message-ID: Date: Thu, 15 May 2008 12:48:59 -0400 From: "Hiram Chirino" Sender: chirino@gmail.com To: users@activemq.apache.org Subject: Re: Need Help with blocking Producer! In-Reply-To: <17170578.post@talk.nabble.com> MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline References: <17141146.post@talk.nabble.com> <4823DC51.7010108@hanik.com> <17141951.post@talk.nabble.com> <4824C4AC.4060101@hanik.com> <17170578.post@talk.nabble.com> X-Google-Sender-Auth: c4157c08d70501d2 X-Virus-Checked: Checked by ClamAV on apache.org On Sun, May 11, 2008 at 11:12 AM, jaya_srini wrote: > > Hi Filip > > I have 4 producers (who are also consumers) on different connections i.e I > create a diffrent connection for each producer. But If multiple threads are > using the same producer then I can see that they might end up using the same > session. > Don't do this.. it's a violation of the JMS spec. It's safer to create a session and producer for each thread and close them out after your done. To avoid the performance hit if creating and closing sessions and producers, use the PooledConnectionFactory [1] [1] http://activemq.apache.org/maven/activemq-core/apidocs/org/apache/activemq/pool/PooledConnectionFactory.html > For sending message asynchrounously, should I be using the jms.useAsyncSend > on the connection? Will this send message asynchronously if multiple threads > are using the same session? > > thanks! > jaya > > > Filip Hanik - Dev Lists wrote: >> >> aah, I see, the issue you are running into is a global lock on the >> session, >> only one message can be sent at a time on the same session. >> so if you have multiple threads using the same session, it will send the >> requests, one at a time >> >> you are probably sending messages synchronously, as opposed to async, >> which is why you see the blocking threads >> >> Filip >> >> jaya_srini wrote: >>> Thanks much for the response Fillip. >>> >>> Can you explain what the producerFlowControl setting does? And what other >>> options if any I can set? >>> >>> >From activemQ admin page I see that the messages are being consumed at >>> the >>> same rate as being produced. I have 4 producers that are also consumers. >>> Currently the consumers when they receive the message just log it to a >>> log >>> file. >>> >>> >>> Filip Hanik - Dev Lists wrote: >>> >>>> that means youre producing messages faster than they are being consumed. >>>> >>>> you could setup a policy entry to turn off flow control >>>> >>>> >>> memoryLimit="10mb"/> >>>> >>>> >>> memoryLimit="10mb"/> >>>> >>>> however, if your consumers never catch up, then you need to decide what >>>> you wanna do with your messages, as eventually you will run out of >>>> resources, being it memory or disk space that holds all the messages. >>>> >>>> the element has a bunch of sub element that you can setup >>>> to control other needs >>>> >>>> Filip >>>> >>>> jaya_srini wrote: >>>> >>>>> hi >>>>> >>>>> We are using ActiveMQ 5.0 release and observing the following on >>>>> production. >>>>> After a certain number of messages are sent the Activemq send blocks. >>>>> The >>>>> thread dump produced the following >>>>> >>>>> daemon prio=6 tid=0x3793f400 nid=0x1f28 waiting for monitor entry >>>>> [0x38aff000..0x38affc98] >>>>> java.lang.Thread.State: BLOCKED (on object monitor) >>>>> at org.apache.activemq.ActiveMQSession.send(ActiveMQSession.java:1587) >>>>> - waiting to lock <0x07c45ea0> (a java.lang.Object) >>>>> at >>>>> org.apache.activemq.ActiveMQMessageProducer.send(ActiveMQMessageProducer.java:226) >>>>> at >>>>> org.apache.activemq.ActiveMQMessageProducerSupport.send(ActiveMQMessageProducerSupport.java:268) >>>>> at >>>>> org.apache.activemq.ActiveMQTopicPublisher.publish(ActiveMQTopicPublisher.java:146) >>>>> >>>>> >>>>> The connection URI looks like the following >>>>> >>>>> failover:(tcp://10.11.12.13:61616?wireFormat.maxInactivityDuration=-1) >>>>> >>>>> I am not sure if jms.useAsyncSend=true or jms.dispatchAsync=true will >>>>> work >>>>> with a failover transport. >>>>> >>>>> Can someone please help me troubleshoot this? Will increasing the >>>>> memory >>>>> limit on the broker help? >>>>> >>>>> >>>>> >>>> >>>> >>> >>> >> >> >> > > -- > View this message in context: http://www.nabble.com/Need-Help-with-blocking-Producer%21-tp17141146s2354p17170578.html > Sent from the ActiveMQ - User mailing list archive at Nabble.com. > > -- Regards, Hiram Blog: http://hiramchirino.com Open Source SOA http://open.iona.com