From activemq-users-return-5540-apmail-geronimo-activemq-users-archive=geronimo.apache.org@geronimo.apache.org Thu Nov 02 20:05:38 2006 Return-Path: Delivered-To: apmail-geronimo-activemq-users-archive@www.apache.org Received: (qmail 25633 invoked from network); 2 Nov 2006 20:05:37 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 2 Nov 2006 20:05:37 -0000 Received: (qmail 57083 invoked by uid 500); 2 Nov 2006 20:05:48 -0000 Delivered-To: apmail-geronimo-activemq-users-archive@geronimo.apache.org Received: (qmail 57067 invoked by uid 500); 2 Nov 2006 20:05:48 -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 57058 invoked by uid 99); 2 Nov 2006 20:05:48 -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 12:05:48 -0800 X-ASF-Spam-Status: No, hits=0.0 required=10.0 tests= X-Spam-Check-By: apache.org Received-SPF: pass (herse.apache.org: local policy) Received: from [209.235.254.11] (HELO exodus.exist.com) (209.235.254.11) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 02 Nov 2006 12:05:31 -0800 Received: from [192.168.200.183] ([205.147.11.148]) (authenticated bits=0) by exodus.exist.com (8.13.1/8.13.1) with ESMTP id kA2K55fG023232 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO) for ; Thu, 2 Nov 2006 15:05:06 -0500 Message-ID: <454A4F71.9060803@exist.com> Date: Fri, 03 Nov 2006 04:05:05 +0800 From: Adrian Co User-Agent: Thunderbird 1.5.0.7 (Windows/20060909) MIME-Version: 1.0 To: activemq-users@geronimo.apache.org Subject: Re: Hanging on big transacted sessions References: <7136242.post@talk.nabble.com> In-Reply-To: <7136242.post@talk.nabble.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked by ClamAV on apache.org Hi, Have you tried configuring the usage manager to use a bigger memory? It could be the broker is running out of memory storing that many messages in RAM and the producer is blocking because it cannot send anymore. But thats just my guess. :) 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. Problem exists on 4.01 and > 4.1snapshot. > > 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(); > } > > } > > } > > >