ActiveMQ
  1. ActiveMQ
  2. AMQ-397

ActiveMQ 3.2 lots of WARN and INFO messages generated on destination clean up

    Details

    • Type: Bug Bug
    • Status: Resolved
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 3.2
    • Fix Version/s: 3.2.1
    • Component/s: Broker
    • Labels:
      None

      Description

      Per Ioan's note:

      It seems that the treatment of dead messages has changed dramatically in 3.2
      .

      Insted of a one-shot delete in 3.1:

      public String getDeleteOldMessagesStatment() {
      return "DELETE FROM "tablePrefix+messageTableName
      " WHERE ( EXPIRATION<>0 AND EXPIRATION<?) OR ID <= " +
      "( SELECT MIN("tablePrefix+durableSubAcksTableName".LAST_ACKED_ID) " +
      "FROM "tablePrefix+durableSubAcksTableName" WHERE " +
      tablePrefix+durableSubAcksTableName+".CONTAINER="tablePrefix+messageTableName
      ".CONTAINER)";
      }

      in 3.2
      doGetOldMessages will get same deleted messages and process them one by one.
      One issue is the extensive logging (could be debug instead of info) in
      JDBCPersistenceAdapter:

      adapter.doGetOldMessages(c, new ExpiredMessageResultHandler() {
      public void onMessage(long seq, String container, String messageID, boolean
      isSentToDeadLetter) {
      try {
      // restore the message from the db
      MessageStore messageStore = createQueueMessageStore(container);
      MessageIdentity messageIdentity = new MessageIdentity(messageID, new
      Long(seq));
      ActiveMQMessage message = messageStore.getMessage(messageIdentity);
      if (message != null){
      log.info("Cleaning up old message in the database: " + message.toString());
      if (message.isExpired() && !isSentToDeadLetter) {
      // send a dead letter
      sendToDeadLetter(message);
      }else {
      log.warn("could not find message from store with identity: " +
      messageIdentity + " in cleanup");
      }
      }
      // clean up old message, use original identity
      cleanupOldMessage(c, new MessageIdentity(messageID, new Long(seq)));
      } catch (JMSException jmse) {
      log.warn("Cleanup expired message failed due to: " + jmse, jmse);
      } catch (SQLException sqle) {
      log.warn("Cleanup expired message failed due to: " + sqle, sqle);
      }
      }

      Maybe instead of deleting one message at a time, for !deadLetterEnabled, the
      old one-shot delete could be preserved. Looks like a major performance
      problem: instead of a single delete SQL there are N or even 2*N SQLs to be
      executed with N=the total messages processed.

      Thanks,
      Ioan

        Activity

        No work has yet been logged on this issue.

          People

          • Assignee:
            Ramzi Saba
            Reporter:
            Ramzi Saba
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development