ActivityMQ的自定义安全插件
上一节提到了ActivityMQ的两种安全插件
Simple Authentication(简单的身份验证)
JAAS authentication(JAAS身份验证)
最先考虑的应该是实现JAAS身份认证,如果一些需求JAAS不能满足的话,就要采取自定义安全插件的方法
1.首先写一个自定义的Broker,继承BrokerFilter,实现addConnection方法,实现的功能是只允许特定的ip访问Broker
public class IPAuthenticationBroker extends BrokerFilter {
List<String> allowedIPAddresses;
Pattern pattern = Pattern.compile("^/([0-9\\.]*):(.*)"); public