You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@activemq.apache.org by BlueRhino <ni...@126.com> on 2013/08/11 05:51:32 UTC

Multiple consumer did not receive the message

Hi everone:
   I used multiple consumer  to receive message from a queue .But It did not
work correctly.These is message in the queue,But the consumer did not get
it.
<http://activemq.2283324.n4.nabble.com/file/n4670263/%E6%9C%AA%E5%91%BD%E5%90%8D.jpg> 
<http://activemq.2283324.n4.nabble.com/file/n4670263/%E6%9C%AA%E5%91%BD%E5%90%8D1.jpg> 
And my code is this:
while (true)
		{
			log.info("GetResMsg listenling.");
			try
			{
                                getSession();
				message = (MapMessage) consumer.receive();
				jsonStr = message.getString(mqMessageName);
				session.commit();
			}
			catch (JMSException e)
			{
				log.warn(e.getMessage());
				getSession();
			}
			catch (Exception e)
			{
				log.warn(e.getMessage());
				getSession();
			}
			try
			{
				Thread.sleep(1000);
			}
			catch (InterruptedException e)
			{
				log.warn(e.getMessage());
			}
		}



--
View this message in context: http://activemq.2283324.n4.nabble.com/Multiple-consumer-did-not-receive-the-message-tp4670263.html
Sent from the ActiveMQ - User mailing list archive at Nabble.com.