activemq-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From venkatesh <venkatesh.sti...@gmail.com>
Subject Re: what is the root cause and how to resolve the error i.e javax.jms.JMSException: No buffer space available (maximum connections reached?
Date Tue, 23 Sep 2014 06:06:29 GMT
Hi Tim,

Please find more details related to this issue and also answers for your
below questions

Your Question: Was there anything unusual in the logs around the time the
errors were seen?  
Answer: Actually No, But there is one scenario during our performance test
where this issue occurs but it's not a valid scenario  

Your Question: Finally, your stack trace from several days ago shows that 
com.spacetimeinsight.alerts.util.MessagingUtils.sendMessage() calls 
org.apache.activemq.ActiveMQConnection.createSession().  

Answer: Please find below code snippet once.
try {
			ConnectionFactory connectionFactory = (ConnectionFactory)
JNDIUtils.getJNDIResouceSource(resourceName);
			connection = connectionFactory.createConnection();
			Session session = connection.createSession(false,
Session.CLIENT_ACKNOWLEDGE);
			connection.start();
			MessageProducer producer = session.createProducer((Destination)
JNDIUtils.getJNDIResouceSource(destinationName));
			producer.send(buildMessage(msg, msgType, session,props));
		} catch (Exception e) {
			//some code here
		} finally {
			if (connection != null) {
				try {
					connection.close();
				} catch (JMSException e) {
					// TODO Auto-generated catch block
					Logger.error("Exception is sendMessage  while close connection ",
MessagingUtils.class, e);
				}
			}

Question: Do you create a new AMQ session for every message you send?  
Answer: Yes

Question: Is there any caching/pooling being done?
Answer: No


Thanks,
Venkatesh



--
View this message in context: http://activemq.2283324.n4.nabble.com/what-is-the-Root-cause-and-how-to-resolve-the-error-i-e-javax-jms-JMSException-No-buffer-space-avail-tp4685440p4685778.html
Sent from the ActiveMQ - User mailing list archive at Nabble.com.

Mime
View raw message