Uploaded image for project: 'ActiveMQ Classic'
  1. ActiveMQ Classic
  2. AMQ-9159

TopicSubscription should only remove nodes from dispatched list that match destination

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • 5.17.2
    • 5.18.0, 5.17.3
    • Broker
    • None

    Description

      I found a minor issue on destination removal from TopicSubscriptions where the dispatched list is cleared but really only nodes that match the removed destination should be removed. There can be multiple destinations associated if it's a wild card consumer. I am putting this as minor as I don't think if it's a real issue in practice as you generally can't remove a destination from an active subscription so since they only get removed when the subscription is closed we would be cleaning up the entire list anyways.

      Either way i figure it's worth fixing. It's not easy to write a test just for this since closing the sub to remove the dest clears everything anyways (as I said) but there are plenty of existing tests that should exercise the change including the in flight statistics tests.

      Edit: I found there is an API method to remove 1 destination from an active wildcard sub so this is a bigger deal. I have a test case that shows this works now and I will push it shortly. If you pass in a timeout greater than 0 to the removeDestination() method in Region then it will just remove the sub from the dest and not fail. The BrokerView does this here for JMX so it's definitely possible to do from JMX and by users.

      The new test shows that the statistics are correct which means the in flight nodes in the list are removed when the destination is gone.

      Attachments

        Activity

          People

            cshannon Christopher L. Shannon
            cshannon Christopher L. Shannon
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: