[prev in list] [next in list] [prev in thread] [next in thread] 

List:       activemq-users
Subject:    Re: Artemis: Restricting access based on protocol
From:       brusdev <bruscinodf () gmail ! com>
Date:       2020-03-31 10:03:16
Message-ID: 1585648996574-0.post () n4 ! nabble ! com
[Download RAW message or body]

Hi Stan,

Artemis supports interceptors[1] to intercept packets entering and exiting
the server. This allows custom code to be executed, e.g. for auditing
packets, filtering or other reasons. So you could use an MQTTInterceptor[2]
to reject connection messages with admin username.

An example of MQTTInterceptor to clarify what I mean:

public class MQTTAdminRejectingInterceptor implements MQTTInterceptor {
   @Override
   public boolean intercept(final MqttMessage packet, RemotingConnection
connection) {
      if (packet instanceof MqttConnectMessage &&
((MqttConnectMessage)packet).payload().userName().compareTo("admin") == 0) {
         return false;
      } else {
         return true;
      }
   }
}

[1]
https://activemq.apache.org/components/artemis/documentation/latest/intercepting-operations.html
[2]
https://activemq.apache.org/components/artemis/documentation/latest/examples.html#interceptor-mqtt

Regards,
Domenico



--
Sent from: http://activemq.2283324.n4.nabble.com/ActiveMQ-User-f2341805.html
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic