1 Reply Latest reply on Aug 23, 2004 1:05 PM by Adrian Brock

    setJMSExpiration: but never expires

    pierre-henri delaval Newbie


      Jboss 3.2.2, Linux, Postgres 7.3.2 messages caches in DB

      Il try to creates messages that should expires after 3 month.
      So i user the code below:

      private void sendMessage(AccountLocal receiver, MexiMessage msg, String destQ, long expires) throws NamingException, JMSException, IOException {
       QueueConnector queue = new QueueConnector(destQ);
       TextMessage jmsMsg = queue.createMessage();
       logger.info("building message for " + receiver.getaddress());
       jmsMsg = setHeaderProperties(receiver, jmsMsg);
       if (expires != 0) {
       Date now = new Date();
       jmsMsg.setJMSExpiration(expires + now.getTime());
       logger.debug("set expires to messages : "+ jmsMsg.getJMSExpiration());
       } else {
       logger.debug("set expires should be zero to messages : "+ jmsMsg.getJMSExpiration());

      I receive messages from incoming queue and treat them for billing and so on so forward them to the outgoing queue using this method.

      The messages a commited and I see them in the jms_message table in DB.. But they never dissapear ??
      The messages are PERSITENT type .

      Should they dissapear automatikely ?
      SHould I activate something in the config ?
      I also try to set the time-to-live in the standartjboss.xml whith:


      But nothing.. the message is still there ?

      Any other Ideas...