activemq-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From swapnonil <>
Subject Cannot browse or consume messages (with ttl setting) from a Queue.
Date Mon, 28 Mar 2011 10:54:57 GMT
Hello Everybody,

I am creating and sending messages from the "Send" tab in Active MQ Web
Console. I am setting the following parameters

1. Queue Name : BackupQueue
2. Persistent Delivery : true
3. Time to live : 300000 (5 minutes)
4. Message Body: "A message in a bottle"

But when I try to consume the message using the following code, the consumer
does not get invoked.

ActiveMQConnectionFactory connectionFactory = new
	Connection connection = connectionFactory.createConnection();
	Session session = connection.createSession(false,
	MessageConsumer  consumer=

	consumer.setMessageListener(new MessageListener()
		public void onMessage(Message message)
			System.out.println("message = " + message);
catch (JMSException e)
	LOGGER.log(Level.SEVERE, "", e);

The consumer does not get invoked even after 5 minutes (i.e after the
message has expired). It goes straight into the DLQ.

But then if I remove the Time to live parameter from the message, my
consumer gets invoked immediately. 
Can't I consume messages for which there is a preset time to live set?

Thanks and With Regards.
Swapnonil Mukherjee

View this message in context:
Sent from the ActiveMQ - User mailing list archive at
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message