Return-Path: Delivered-To: apmail-activemq-users-archive@www.apache.org Received: (qmail 99439 invoked from network); 19 Feb 2007 10:35:36 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 19 Feb 2007 10:35:36 -0000 Received: (qmail 9662 invoked by uid 500); 19 Feb 2007 10:35:44 -0000 Delivered-To: apmail-activemq-users-archive@activemq.apache.org Received: (qmail 9643 invoked by uid 500); 19 Feb 2007 10:35:44 -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 9634 invoked by uid 99); 19 Feb 2007 10:35:44 -0000 Received: from herse.apache.org (HELO herse.apache.org) (140.211.11.133) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 19 Feb 2007 02:35:44 -0800 X-ASF-Spam-Status: No, hits=-0.0 required=10.0 tests=SPF_HELO_PASS,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (herse.apache.org: domain of lists@nabble.com designates 72.21.53.35 as permitted sender) Received: from [72.21.53.35] (HELO talk.nabble.com) (72.21.53.35) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 19 Feb 2007 02:35:32 -0800 Received: from [72.21.53.38] (helo=jubjub.nabble.com) by talk.nabble.com with esmtp (Exim 4.50) id 1HJ5rR-0003Bg-RG for users@activemq.apache.org; Mon, 19 Feb 2007 02:35:09 -0800 Message-ID: <9040119.post@talk.nabble.com> Date: Mon, 19 Feb 2007 02:35:09 -0800 (PST) From: Paul French To: users@activemq.apache.org Subject: Re: Sending Async messages to temp queue really slow In-Reply-To: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Nabble-From: paul.french@frenchiesystems.com References: <9015159.post@talk.nabble.com> X-Virus-Checked: Checked by ClamAV on apache.org I don't understand any potential contention issues in ActiveMQ so I thought I may as well use a connection for the incoming and another connection for the outgoing. I do not create a connection/session/producer per request. They are created only once. It just seems that sending messages to a temp queue that you specify in the send call is slow? i.e. The following are only created once: connection = connectionFactory.createConnection(); session = connection.createSession(false,Session.CLIENT_ACKNOWLEDGE); producer = session.createProducer(null); // set as null since we do not know the destination connection.start(); Each call does....... producer.send(tempQueue, jmsResponse); Any idea why this is significanly slower then a call to a pre-defined known queue. James.Strachan wrote: > > On 2/17/07, Paul French wrote: >> I am using the defualt install of activeMQ 4.1.0 >> I've turned off persistence and increased memory-manager setting to 500MB >> I've also updated the startup script so that the java heap can increase >> to >> 1G of memory if required >> >> The messaging layer of my app is simple. The client creates a temp queue >> on >> the broker and then sends messages async to a named main queue where each >> message has the JMS reply to set to the temp queue. >> >> The server consumes messages from the main queue does some processing and >> then sends the resulting message to the temp queue. The client then >> consumes >> the messages off the temp queue. >> >> On the server consuming messages is fast. However sending the results >> back >> to the temp queue is slow. >> >> The server consumes messages by creating a single connection, a single >> session and a single consumer. > > BTW why is the server single threaded? Why not create a bunch of > sessions & listeners. > >> All of these objects are created on startup >> and the consumer has the main queue set on it when created. e.g. >> >> connection = connectionFactory.createConnection(); >> session = >> connection.createSession(false,Session.CLIENT_ACKNOWLEDGE); >> consumer = session.createConsumer(mainQueueName); >> connection.start(); >> >> In the appropriate place the following gets called >> >> jmsRequest = consumer.receive(); >> jmsRequest.acknowledge(); >> >> >> The server produces messages by creating another connection, a session >> and a >> single producer. > > Why? Thats gonna be very slow. Why not just reuse the same session > that you are using for consuming and just cache a MessageProducer you > can use for sending (and do async sends) > > -- > > James > ------- > http://radio.weblogs.com/0112098/ > > -- View this message in context: http://www.nabble.com/Sending-Async-messages-to-temp-queue-really-slow-tf3242950s2354.html#a9040119 Sent from the ActiveMQ - User mailing list archive at Nabble.com.