Github user jbertram commented on a diff in the pull request:

    https://github.com/apache/activemq-artemis/pull/1539#discussion_r139424530
  
    --- Diff: 
artemis-protocols/artemis-mqtt-protocol/src/main/java/org/apache/activemq/artemis/core/protocol/mqtt/MQTTProtocolManager.java
 ---
    @@ -172,4 +177,8 @@ public void invokeIncoming(MqttMessage mqttMessage, 
MQTTConnection connection) {
        public void invokeOutgoing(MqttMessage mqttMessage, MQTTConnection 
connection) {
           super.invokeInterceptors(this.outgoingInterceptors, mqttMessage, 
connection);
        }
    +
    +   public Map<String, MQTTConnection> getConnectedClients() {
    +      return connectedClients;
    --- End diff --
    
    If I returned an immutable view of the map then I wouldn't be able to 
actually update it which would break 
org.apache.activemq.artemis.core.protocol.mqtt.MQTTConnectionManager#validateClientId.
  I could add a new method (e.g. addConnectedClient(String, MQTTConnection)), 
but I don't see much benefit of doing that over what's happening now.


---

Reply via email to