Artemis 代理拦截 mqtt 客户端连接

Artemis broker Intercept mqtt client connection

我在我的 artemis 代理中添加了一个 mqtt 拦截器以拦截 mqtt 客户端连接:

  public class SimpleMQTTInterceptor implements MQTTInterceptor 
  { 

    @Override 
    public boolean intercept(final MqttMessage mqttMessage, RemotingConnection connection) throws ActiveMQException 
    { 

            System.out.println("MQTT Interceptor gets called "); 

            if (mqttMessage instanceof MqttConnectMessage) 
            { 
                    System.out.println("MQTT connection intercepted "); 
            } 
            return true; 
    } 

我的客户端 apache paho 通过此端口连接到代理 "ws://0.0.0.0:61614"。
我的问题是只有发布到主题的消息被拦截。
为什么这不拦截 CONNECT 消息?

ActiveMQ Artemis的当前版本,2.2.0,在我写这篇回复的时候,只支持拦截MQTT Publish控制包。我 opened a pull request 添加了该功能,因此它应该出现在未来的版本中。