Uploaded image for project: 'JBoss A-MQ'
  1. JBoss A-MQ
  2. ENTMQ-2200

Expired messages not removed from Database.

    XMLWordPrintable

Details

    • +
    • Hide

      1. Set up a Database like mysql or postgresql;
      2. unzip A-MQ630310, and configured its "<persistenceAdapter>" to use "jdbcPersistenceAdapter";
      3. Start A-MQ standalone server, install datasource bundles.
      4. Start a producer from outside, it sends large size messages which has TTL for 120s to a queue to make PFC happen;
      5. Check the message from Database after TTL, you can see messages are still there;
      6. Purge the queue, then use small size message with the same TTL to test again, you can see the difference.

      Show
      1. Set up a Database like mysql or postgresql; 2. unzip A-MQ630310, and configured its "<persistenceAdapter>" to use "jdbcPersistenceAdapter"; 3. Start A-MQ standalone server, install datasource bundles. 4. Start a producer from outside, it sends large size messages which has TTL for 120s to a queue to make PFC happen; 5. Check the message from Database after TTL, you can see messages are still there; 6. Purge the queue, then use small size message with the same TTL to test again, you can see the difference.

    Description

      Message that were set TTL by <to uri="jms:queue:xyz?timeToLive=1000" /> or producer.setTimeToLive(5000) in a queue will be discarded or move to DLQ if it exceed the TTL's value.

      But if I used Database instead of Kahadb as persistence store, the behaviour sometime didn't work well, the message will stay in the queue forever.

      Based on tests, I found the rule: if messages quickly occupied a queue's memory over 70% which is default watermark of producerFlowControl, at the meantime, producerFlowControl=true, from DEUBG log, we can see

      memory=70%, size=848, pending=0 toPageIn: 200, force:false, Inflight: 0, pagedInMessages.size 0, pagedInPendingDispatch.size 0, enqueueCount: 3706, dequeueCount: 2858, memUsage:734198, maxPageSize:200
      

      As you can see, in this case, pagedInMessages.size and pagedInPendingDispatch.size are all 0 forever, after that, expired message will stay in Database forever.

      If I send message slowly, before memory reached 70%, pagedInMessages.size and pagedInPendingDispatch.size has value, in this case, expired message will be removed.

      I did the same test with Kahadb, everything worked as expected, expired messages will be removed even PFC triggered.

      Attachments

        Activity

          People

            gtully@redhat.com Gary Tully
            zhangxu1324_jira xu zhang (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: