Artemis代理拦截mqtt客户端连接



我在 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"连接到代理。
我的问题是只有发布到主题的消息才会被拦截。
为什么这不拦截连接消息?

当前版本的 ActiveMQ Artemis,2.2.0,在我写这个响应的时候,只支持拦截 MQTT 发布控制数据包。我打开了一个拉取请求,添加了该功能,因此,它应该存在于未来的版本中。

最新更新