}));
assertEquals("correct dequeue", 5, durableSubscriptionView.getDequeueCounter());
ObjectName destinationName = broker.getAdminView().getTopics()[0];
TopicViewMBean topicView = (TopicViewMBean) broker.getManagementContext().newProxyInstance(destinationName, TopicViewMBean.class, true);
assertEquals("correct enqueue", 10, topicView.getEnqueueCount());
assertEquals("still zero dequeue, we don't decrement on each sub ack to stop exceeding the enqueue count with multiple subs", 0, topicView.getDequeueCount());
assertEquals("inflight", 5, topicView.getInFlightCount());
session.close();
con.close();
// check some counters when inactive
ObjectName inActiveDurableSubName = broker.getAdminView().getInactiveDurableTopicSubscribers()[0];
LOG.info("inactive durable sub name: " + inActiveDurableSubName);
DurableSubscriptionViewMBean durableSubscriptionView1 = (DurableSubscriptionViewMBean)
broker.getManagementContext().newProxyInstance(inActiveDurableSubName, DurableSubscriptionViewMBean.class, true);
assertTrue("is not active", !durableSubscriptionView1.isActive());
assertEquals("all enqueued", keepDurableSubsActive ? 10 : 0, durableSubscriptionView1.getEnqueueCounter());
assertEquals("correct awaiting ack", 0, durableSubscriptionView1.getMessageCountAwaitingAcknowledge());
assertEquals("correct dequeue", keepDurableSubsActive ? 5 : 0, durableSubscriptionView1.getDequeueCounter());
// destination view
assertEquals("correct enqueue", 10, topicView.getEnqueueCount());
assertEquals("still zero dequeue, we don't decrement on each sub ack to stop exceeding the enqueue count with multiple subs", 0, topicView.getDequeueCount());
assertEquals("inflight back to 0 after deactivate", 0, topicView.getInFlightCount());
// consume the rest
con = createConnection("cliId1");
session = con.createSession(false, Session.AUTO_ACKNOWLEDGE);
consumer = session.createDurableSubscriber(topic, "SubsId", null, true);