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

Database rows associated with disconnected durable subscribers are not removed when subscriptions are deployed

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Won't Do
    • Icon: Major Major
    • None
    • JBoss A-MQ 6.3
    • broker
    • None
    • False
    • False
    • undefined
    • Hide
      1. Configured A-MQ 6.3 to use a database as the message store. Customer is using Oracle, but I suspect all databases will behave the same.
      2. Conect a client that acts as a durable subscriber to a particular topic
      3. Publish a message to that topic
      4. Disconnect the client
      5. Publish a large number (e.g., 1000) message to the topic
      6. Note that the Hawtio console only reports 1 message in its overall statistics, because durable subscriber backlog is not included
      7. Note that the Hawtio entry for the specific durable subscriber shows a large number of pending messages
      8. Check the number of rows in the ACTIVEMQ_MSGS table – it will be at least as large as the durable subscriber backlog
      9. Using the Hawtio console, destroy the durable subscription
      10. Check the number of rows in ACTIVEMQ_MSGS – it is still large
      11. Restart the broker
      12. Check the number of rows in ACTIVEMQ_MSGS – some rows will have been removed, but there are still many rows.
      Show
      Configured A-MQ 6.3 to use a database as the message store. Customer is using Oracle, but I suspect all databases will behave the same. Conect a client that acts as a durable subscriber to a particular topic Publish a message to that topic Disconnect the client Publish a large number (e.g., 1000) message to the topic Note that the Hawtio console only reports 1 message in its overall statistics, because durable subscriber backlog is not included Note that the Hawtio entry for the specific durable subscriber shows a large number of pending messages Check the number of rows in the ACTIVEMQ_MSGS table – it will be at least as large as the durable subscriber backlog Using the Hawtio console, destroy the durable subscription Check the number of rows in ACTIVEMQ_MSGS – it is still large Restart the broker Check the number of rows in ACTIVEMQ_MSGS – some rows will have been removed, but there are still many rows.

      When the broker is using a JDBC database as a message store, it appears to store one row in the ACTIVEMQ_MSGS table for each pending message for each durable subscriber to each topic. It is possible for a durable subscriber to disconnect, and not reconnect for a long time, if ever. As long as it is disconnected, rows accumulate in the ACTIVEMQ_MSGS table.

      Over time, as durable subscribers come and go, the ACTIVEMQ_MSGS table can get very large – tens of millions of rows in this case. That doesn't stop the broker working when it is up, but start-up and failover can take tens of minutes. This means that there can be significant interruptions in service when, in a system using simple disk storage, there would not be.

      I had thought that destroying the inactive subscriptions using the Hawtio console would cause the associated database rows to be cleaned up, but it does not.

       

              Unassigned Unassigned
              rhn-support-kboone Kevin Boone
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

                Created:
                Updated:
                Resolved: