Uploaded image for project: 'Application Server 3  4  5 and 6'
  1. Application Server 3 4 5 and 6
  2. JBAS-4204

Don't allow removal of durable topic subscriptions when there are active subscribers or unacknowledged messages

    XMLWordPrintable

Details

    Description

      According to the spec, it is an application error to unsubscribe a Durable Topic Subscription
      when there is an active subscriber or there are unacknowledged messages/uncommitted
      transactions for the subscription.

      We don't currently check for this condition, except that it can lead to an NPE
      if somebody does it which will then might also leave the state manager in an inconsistent state
      (it can only be fixed by rebooting).

      Since this is an application error, the application should receive an error
      (javax.jms.IllegalStateException) if it is tried.
      It should not lead to corrupted server state.

      The code already exists for this (related to disallowing the deletion of temporary queues with
      active subscribers) so it is just a case of:

      1) Updating the "inUse" check in BasicQueue to also look for unacknowledged messages
      (this also covers uncommitted transactions). This check also applies to temporary queues/topics.

      2) Adding the code to check "inUse" in JMSTopic.destroyDurableSubscription()
      before doing the removeAllMessages().

      Attachments

        Activity

          People

            adrian.brock Adrian Brock (Inactive)
            starksm64 Scott Stark (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: