mqtt用户名密码activemq

为mqtt连接添加用户名密码

默认没有用户名密码

修改配置文件

image

添加用户名密码

        <plugins>

            <simpleAuthenticationPlugin>

               <users>
                  <authenticationUser username="test1" password="123456" groups="users"/>
                  <authenticationUser username="test2" password="654321" groups="users,admins"/>
               </users>

            </simpleAuthenticationPlugin>

        </plugins>

添加完效果

image

重启mqtt

未添加用户名连接测试

授权失败

添加用户名连接测试

image

连接成功

image

posted @ 2020-07-05 20:38  thomas_blog  阅读(5300)  评论(0编辑  收藏  举报