"ActiveMQ Series" - Security Mechanism

1. Add user information

The activemq console is deployed using jetty, and changing the password requires the corresponding configuration file. /conf/jetty-realm.properties

2. Activemq is equipped with a security mechanism, and only users who meet the authentication can send and obtain information. /conf/activemq.xml add the configuration after line 123 (inside the broker node). The user here is the real java program to connect mq

<plugins>
    <simpleAuthenticationPlugin>
        <users>
            <authenticationUser username="kim" password="kim" groups="admins,publishers,consumers"/>    
        </users>
    </simpleAuthenticationPlugin>
</plugins>

java program

ConnectionFactory connectionFactory = new ActiveMQConnectionFactory("kim","kim", "tcp://localhost:61616");

 

 

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=325338633&siteId=291194637