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

JDBC Store - received messages from durable topic is not removed after unsubscribe

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Open
    • Major
    • Resolution: Unresolved
    • 5.15.3
    • None
    • Broker, JDBC
    • None

    Description

      It seems, that received messages from durable subscriber is not removed from JDBC persistence layer (ACTIVEMQ_MSGS), when unsubscribe operation is invoked.

      Let suppose following scenario:

      • create (register) durable topic subscriber
      • close durable topic subscriber, but leave it "subscribed"
      • send 10 messages to topic
      • check count messages in JDBC store (10 is expected)
      • create (open) durable topic subscriber again and receive 10 messages (no next messages is prepared)
      • "unsubscribe" durable topic subscriber (session.unsubscribe(...))
      • check count of messages in JDBC store (0 is expected, but 10 is a reality)

      IMHO there is a problem, that session.unsubscribe() only removes entry from ACTIVEMQ_ACKS table (topicStore.deleteSubscription(...)). It means that messages, which are currently present in ACTIVEMQ_MSGS table are never removed, because the delete statement in JDBCPersistenceAdapter.cleanup() method joins ACTIVEMQ_ACKS table (but subscription was already removed).

      The "Removing inactive subscribers" has no effect to this test case, because durable subscription is removed from TopicRegion.durableSubscriptions field, when session.unsubscribe(...) method is invoked.

      Very simple test case is attached.

      Attachments

        Activity

          People

            Unassigned Unassigned
            rkraus Radek Kraus
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated: