Hi, 

I started using ActiveMQ via JMS.
I encountered some issue that the Topic is not purged even if i set the
NON_PERSISTENT mode,
and the time to live is for 10 seconds(of course i tried even less).

what am i doing wrong?
or is it maybe a bug?

i have the piece of code:

public class MyPublisher() {

  private int   deliveryMode = DeliveryMode.NON_PERSISTENT;
  private long  timeToLive   = 10 * 1000; // 10 * 1000 = 10 Seconds
  private int   priority     = Message.DEFAULT_PRIORITY;

  private String topicName   = "someTopicName";
  
  private TopicSession   topicSession;
  private TopicPublisher topicPublisher;
  
  
  private void init(Connection conn)
                TopicSession topicSession = 
(TopicSession)conn.createSession(false,
Session.AUTO_ACKNOWLEDGE);
  
      Topic topic = topicSession.createTopic(topicName);
  
                topicPublisher = topicSession.createPublisher(rangeUpdateTopic);
  
                topicPublisher.setDeliveryMode(deliveryMode);
                topicPublisher.setPriority(priority);
                topicPublisher.setTimeToLive(timeToLive);
  }
  
  
  public void publish(String val) throws JMSException {
                try {
         Message messageToPublish = topicSession.createTextMessage(val);
  
                         topicPublisher.publish(messageToPublish);
                        
                } catch (JMSException e) {
                        throw new RuntimeException(e);
                }
  }

}






-- 
View this message in context: 
http://www.nabble.com/Messages-in-topic-are-not-purged...-version-5.1-and-5.2-tp21001783p21001783.html
Sent from the ActiveMQ - Dev mailing list archive at Nabble.com.

Reply via email to