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

Active Durable Topic Consumer is not re-assigned to Topic after it is deleted and recreated

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • 5.5.1
    • 5.6.0
    • Broker
    • Mac OS X (10.7.2)

    • Patch Available

    Description

      If I have a durable subscriber on a topic, which is active; and a message
      producer is sending to the topic. If the topic is deleted (whist the durable
      consumer is active), should the durable subscription be re-added to the
      topic (as a consumer) when it the TOPIC is subsequently recreated by the producer
      on the next message send?

      When replicating the above with a QUEUE that has an active consumer and producer.
      If you delete the queue whilst the producer and consumer are active, the next message
      sent by the producer recreates the QUEUE, and the active consumer is then registered
      as a consumer on the queue. However, this isn't the case for an active durable consumer
      (which isn't re-added as a consumer); when the TOPIC is subsequently recreated by the
      producer's next message to the topic.

      It could be the case that you should not be able to delete the topic, via jmx, when
      an active durable consumer is present? If so, then should this logic also apply to the queue? (not able
      to delete it via jmx when it has an active consumer).

      To re-attach the active durable consumer to the newly created topic, in

      You could apply the attached patch to the {{public void addSubscription(ConnectionContext context, final Subscription sub) throws Exception }} method (line 112) to re-add the durable consumer. (junit included)


      A related question to the above is should the advisory

      • "ActiveMQ.Advisory.Consumer.Topic.XXX" or
      • "ActiveMQ.Advisory.Consumer.Queue.XXX"

      Be recreated when the active consumer reattaches to the queue or topic?

      When you remove, via jmx, the Queue or Topic the associated Consumer Advisory Topic is also removed.
      When the queue or topic is recreated, and the consumer re-assigned to the new queue; the advisory isn't
      created/fired. Would this cause any issues? Should an advisory be sent? does it affect dynamicallyIncludedDestinations
      and the use of the Advisories when using a network of brokers?

      cheers
      /dom

      Attachments

        1. Topic.patch.txt
          1 kB
          Dominic Tootell
        2. CountMessagesRecievedOnDurableTopicAfterTopicDeletion.java
          6 kB
          Dominic Tootell

        Activity

          People

            rajdavies Robert Davies
            dominict Dominic Tootell
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: