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
ActiveMQConnectionFactory(backUpServerUrl);
try
{
        Connection connection = connectionFactory.createConnection();
        Session session = connection.createSession(false,
Session.AUTO_ACKNOWLEDGE);
        MessageConsumer  consumer=
session.createConsumer(session.createQueue("BackupQueue"));

        consumer.setMessageListener(new MessageListener()
        {
                public void onMessage(Message message)
                {
                        System.out.println("message = " + message);
                }
        });
        connection.start();
}
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: 
http://activemq.2283324.n4.nabble.com/Cannot-browse-or-consume-messages-with-ttl-setting-from-a-Queue-tp3411305p3411305.html
Sent from the ActiveMQ - User mailing list archive at Nabble.com.

Reply via email to