aha! So it seems that is works indeed, but the qpid-tool (list queue, then
show <queueID>) and cumin also (it probably uses the same thing under the
hood) reports that there are still messages there, when in fact they have
been removed.
Here is a sample of what I do:
Properties properties = new Properties();
properties.load(this.getClass().getResourceAsStream("qpid.properties"));
Context context = new InitialContext(properties);
ConnectionFactory connectionFactory = (ConnectionFactory)
context.lookup("qpidConnectionfactory");
Connection connection = connectionFactory.createConnection();
connection.start();
Session
session=connection.createSession(false,Session.AUTO_ACKNOWLEDGE);
TextMessage message = session.createTextMessage("Expire Queue
Message");
// 10 seconds
message.setJMSExpiration(10000);
And then after 10 seconds
./drain (/usr/share/doc/python-qpid-0.10/examples/api) MY_QUEUE shows
nothing meaning that the messages have been removed.
Cheers,
Eugene.
--
View this message in context:
http://apache-qpid-developers.2158895.n2.nabble.com/MRG-Java-JMS-Expiration-tp7171854p7172014.html
Sent from the Apache Qpid developers mailing list archive at Nabble.com.
---------------------------------------------------------------------
Apache Qpid - AMQP Messaging Implementation
Project: http://qpid.apache.org
Use/Interact: mailto:[email protected]