Return-Path: Delivered-To: apmail-geronimo-activemq-users-archive@www.apache.org Received: (qmail 89776 invoked from network); 2 Nov 2006 22:50:48 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 2 Nov 2006 22:50:48 -0000 Received: (qmail 28512 invoked by uid 500); 2 Nov 2006 22:50:59 -0000 Delivered-To: apmail-geronimo-activemq-users-archive@geronimo.apache.org Received: (qmail 28499 invoked by uid 500); 2 Nov 2006 22:50:59 -0000 Mailing-List: contact activemq-users-help@geronimo.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: activemq-users@geronimo.apache.org Delivered-To: mailing list activemq-users@geronimo.apache.org Received: (qmail 28490 invoked by uid 99); 2 Nov 2006 22:50:59 -0000 Received: from herse.apache.org (HELO herse.apache.org) (140.211.11.133) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 02 Nov 2006 14:50:59 -0800 X-ASF-Spam-Status: No, hits=-0.0 required=10.0 tests=SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (herse.apache.org: domain of rajdavies@gmail.com designates 66.249.92.169 as permitted sender) Received: from [66.249.92.169] (HELO ug-out-1314.google.com) (66.249.92.169) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 02 Nov 2006 14:50:45 -0800 Received: by ug-out-1314.google.com with SMTP id m2so299732ugc for ; Thu, 02 Nov 2006 14:50:24 -0800 (PST) DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:mime-version:in-reply-to:references:content-type:message-id:content-transfer-encoding:from:subject:date:to:x-mailer; b=cS9yybxepvheSqGpG7UGdw4xeU+NRr5uMO2t8MbLSIQRw7WJoWkx65+lt1NmHvkGAFzeZZ2fk/dD5tdi8OHSjicwvJu3ncFqfOtUrlrWof8v4LbuzCV3jHG4xk1UTt2arw1mmzKK4kfu+53cnhYu3lYwZeCgg2F1JEfSVu1hez4= Received: by 10.67.20.3 with SMTP id x3mr1591814ugi.1162507824170; Thu, 02 Nov 2006 14:50:24 -0800 (PST) Received: from ?192.168.15.105? ( [86.133.81.80]) by mx.google.com with ESMTP id w40sm24313ugc.2006.11.02.14.50.23; Thu, 02 Nov 2006 14:50:23 -0800 (PST) Mime-Version: 1.0 (Apple Message framework v752.3) In-Reply-To: <7136242.post@talk.nabble.com> References: <7136242.post@talk.nabble.com> Content-Type: text/plain; charset=US-ASCII; delsp=yes; format=flowed Message-Id: <273F0666-7780-4831-BA56-BE8E252CA953@gmail.com> Content-Transfer-Encoding: 7bit From: Rob Davies Subject: Re: Hanging on big transacted sessions Date: Thu, 2 Nov 2006 22:50:19 +0000 To: activemq-users@geronimo.apache.org X-Mailer: Apple Mail (2.752.3) X-Virus-Checked: Checked by ClamAV on apache.org I think you need to configure the prefetch size for the consumer - by default - the prefetch limit would be less than 10000 for a queue see: http://www.activemq.org/site/what-is-the-prefetch-limit-for.html for some hints about increasing the prefetch limits for a consumer On 2 Nov 2006, at 15:55, cwl999 wrote: > > I'm writing an application that needs to produce at most 10000 > messages for > every message consumed. This has to happen in a single > transaction. If I > use a non transacted session, everything works fine (but doesn't > meet the > requirements). If I set it to use a transacted session, the > connection > hangs after a while with the following errors > > 3081 [main] DEBUG org.apache.activemq.ActiveMQSession - Sending > message: > ActiveMQObjectMessage {commandId = 0, responseRequired = false, > messageId = > ID:07166HOBDGXP-4713-1162482684322-1:0:1:1:109, originalDestination > = null, > originalTransactionId = null, producerId = > ID:07166HOBDGXP-4713-1162482684322-1:0:1:1, destination = queue:// > AWTX.TEST, > transactionId = TX:ID:07166HOBDGXP-4713-1162482684322-1:0:1, > expiration = 0, > timestamp = 1162482687730, arrival = 0, correlationId = null, > replyTo = > null, persistent = true, type = null, priority = 4, groupID = null, > groupSequence = 0, targetConsumerId = null, compressed = false, > userID = > null, content = org.apache.activeio.packet.ByteSequence@9980d5, > marshalledProperties = null, dataStructure = null, > redeliveryCounter = 0, > size = 0, properties = null, readOnlyProperties = true, > readOnlyBody = true} > 15001 [ActiveMQ Scheduler] DEBUG > org.apache.activemq.transport.InactivityMonitor - A send is in > progress > 29956 [ActiveMQ Scheduler] DEBUG > org.apache.activemq.transport.InactivityMonitor - A send is in > progress > 30003 [ActiveMQ Scheduler] DEBUG > org.apache.activemq.transport.InactivityMonitor - Message received > since > last read check, resetting flag: > > I've written a test prog to demo this > > import java.io.Serializable; > > import javax.jms.Connection; > import javax.jms.JMSException; > import javax.jms.MessageProducer; > import javax.jms.ObjectMessage; > import javax.jms.Session; > > import org.apache.activemq.ActiveMQConnectionFactory; > import org.apache.log4j.BasicConfigurator; > import org.apache.log4j.Logger; > > public class Main implements Serializable > { > static private Logger logger = Logger.getLogger(Main.class); > > byte[] dummy = new byte[100000]; > > /** > * @param args > */ > public static void main(String[] args) > { > BasicConfigurator.configure(); > try > { > ActiveMQConnectionFactory factory = new ActiveMQConnectionFactory( > "tcp://localhost:61616"); > Connection connection; > connection = factory.createConnection(); > Session session = connection.createSession(true, > Session.SESSION_TRANSACTED); > MessageProducer producer = > session.createProducer(session.createQueue("AWTX.TEST")); > for (int i = 0; i < 1000; i++) > { > System.out.println(i); > ObjectMessage objectMessage = session.createObjectMessage(new > Main()); > producer.send(objectMessage); > } > producer.close(); > session.commit(); > session.close(); > connection.close(); > } > catch (JMSException e) > { > // TODO Auto-generated catch block > e.printStackTrace(); > } > > } > > } > > > -- > View this message in context: http://www.nabble.com/Hanging-on-big- > transacted-sessions-tf2560589.html#a7136242 > Sent from the ActiveMQ - User mailing list archive at Nabble.com. >