activemq-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Adrian Co <...@exist.com>
Subject Re: Hanging on big transacted sessions
Date Thu, 02 Nov 2006 20:05:05 GMT
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();
> 		}
>
> 	}
>
> }
>
>
>   


Mime
View raw message