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

    setJMSExpiration: but never expires

    pierre-henri delaval Newbie

      Hello,

      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);
       jmsMsg.setText(MexiMessageUtil.toString(msg));
       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());
       }
       queue.send(jmsMsg);
       queue.close();



      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:

      <MDBConfig>
       <ReconnectIntervalSec>10</ReconnectIntervalSec>
       <DLQConfig>
       <DestinationQueue>queue/DLQ</DestinationQueue>
       <MaxTimesRedelivered>10</MaxTimesRedelivered>
       <TimeToLive>60000</TimeToLive>
       </DLQConfig>
       </MDBConfig>
      


      But nothing.. the message is still there ?

      Any other Ideas...