[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[GitHub] activemq-artemis pull request #2466: ARTEMIS-2206 The MQTT consumer reconnec...

Github user onlyMIT commented on a diff in the pull request:
    --- Diff: artemis-protocols/artemis-mqtt-protocol/src/main/java/org/apache/activemq/artemis/core/protocol/mqtt/ ---
    @@ -194,12 +191,13 @@ private synchronized void removeSubscription(String address) throws Exception {
           SimpleString internalQueueName = getQueueNameForTopic(internalAddress);
    -      ServerConsumer consumer = consumers.get(address);
    +      Set<Consumer> queueConsumers = session.getServer().queueConsumersQuery(internalQueueName);
    --- End diff --
    In the â??queueConsumersQueryâ?? method, use 'queueName' to query 'Binding' and get a queue through â??Bindingâ??. I think I am getting all the consumers in the specified queue, not all consumers at the same address.You can check the details of the 'queueConsumersQuery' method.
    In the â??ActiveMQServerImpl.destroyQueueâ?? method, the number of consumers on a queue is also obtained in this way.Originally I wanted to put the shutdown consumer code here, and later found that there were multiple calls to the â??ActiveMQServerImpl.destroyQueueâ?? method, and I abandoned the idea of putting the consumer code off here.