activemq-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From pbolle <bo...@productandconcept.com>
Subject problem set the expiration time for durable topic messages
Date Wed, 04 Jul 2007 15:42:47 GMT

Hi ActiveMQ users,

In my project I use a durable topic to distribute events. The only problem I
have is to set the expiration time. I am not sure if I put an error into my
program or found an activeMQ but I published the message with the following
code:
publisher:
connection = factory.createConnection();    	
Session session = connection.createSession(false, Session.AUTO_ACKNOWLEDGE);
Topic topic = session.createTopic("topic.article.messages");

ObjectMessage message = session.createObjectMessage(baseArticle);
message.setJMSExpiration(System.currentTimeMillis() + JMS_TIMEOUT);
message.setStringProperty("articleId", baseArticle.getArticleId());
publisher.send(message);

subscriber:
ActiveMQConnectionFactory factory = new ActiveMQConnectionFactory(url);
connection = factory.createConnection();
connection.setClientID(subscriberId);
Session session = connection.createSession(false, Session.AUTO_ACKNOWLEDGE);
Topic topic = session.createTopic(JMS_TOPIC);
MessageConsumer consumer = session.createDurableSubscriber(topic,
subscriberId);
consumer.setMessageListener(this);
connection.start();

any help is welcome
Regards Philipp 

-- 
View this message in context: http://www.nabble.com/problem-set-the-expiration-time-for-durable-topic-messages-tf4025141s2354.html#a11433150
Sent from the ActiveMQ - User mailing list archive at Nabble.com.


Mime
View raw message