2 Replies Latest reply on Jan 19, 2005 11:01 AM by trickard

    Unreadable messages JDBC3 Persistence Manager

    trickard Newbie

      I posted this in user but got no response. Maybe somebody has some ideas here.

      Messages left in a topic with a durable subscriber when jboss is shutdown will never be sent/received. They appear in the message count in the jmx console but if mq must go back and load it from storage the message will never be sent to a receiver. Post restart, when a subscriber connects with the appropriate clientID and subscription name if an internal ref to the message does not exist PersistenceMgr.loadFromStorage reads the jms_message_log table using keys messageid and destination. The destination value for topic messages with durable subscribers is '*' in jms_message_log.

       c = this.getConnection();
       stmt = c.prepareStatement(SELECT_MESSAGE);
       stmt.setLong(1, messageRef.messageId);
       System.out.println("x" + messageReg.getPersistnen
       stmt.setString(2, messageRef.getPersistentKey());
       rs = stmt.executeQuery();
       if (rs.next())
       return extractMessage(rs, 2);
       return null;

      The messageRef.getPersistentKey returns the destination from jms_reference_log (clientid, name, and selector), the row is never found and the function returns null.

      This also blocks any new messages that are added after the startup. When a subscriber connects and attempts to get messages either synchronously or asynchronously the system throws a null pointer exception due to the code above and never gets past the first message.

      Messages written to topics with durable subscribers that are read before a shutdown work as the system has an internal ref of some sort and does not attempt to load from storage.

      Is there a patch that makes this work anywhere that anyone knows of or should I just switch to JDBC2 which does not include the jms_reference_log table and hopefully works on restart