博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
ActiveMQ安全机制设置
阅读量:7046 次
发布时间:2019-06-28

本文共 2731 字,大约阅读时间需要 9 分钟。

一、设置后台管理密码

a、ActiveMQ使用的是jetty服务器,找到D:\div\apache-activemq-5.11.1\conf\jetty.xml文件:

注意:低版本的authenticate的属性默认为"false",需要改为"true",高版本的已经默认为true

b、修改控制台的登录用户名密码conf/jetty-realm.properties文件中

## ---------------------------------------------------------------------------## Licensed to the Apache Software Foundation (ASF) under one or more## contributor license agreements.  See the NOTICE file distributed with## this work for additional information regarding copyright ownership.## The ASF licenses this file to You under the Apache License, Version 2.0## (the "License"); you may not use this file except in compliance with## the License.  You may obtain a copy of the License at## ## http://www.apache.org/licenses/LICENSE-2.0## ## Unless required by applicable law or agreed to in writing, software## distributed under the License is distributed on an "AS IS" BASIS,## WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.## See the License for the specific language governing permissions and## limitations under the License.## ---------------------------------------------------------------------------# Defines users that can access the web (console, demo, etc.)# username: password [,rolename ...]#admin: admin, admin#user: user, userljq: ljq, admin

 

二、消息生产者和消费者密码认证

a、D:\div\apache-activemq-5.11.1\conf\activemq.xml添加生产者和消费者密码认证信息:

b、设置用户名密码,文件在D:\div\apache-activemq-5.11.1\conf\credentials.properties

## ---------------------------------------------------------------------------## Licensed to the Apache Software Foundation (ASF) under one or more## contributor license agreements.  See the NOTICE file distributed with## this work for additional information regarding copyright ownership.## The ASF licenses this file to You under the Apache License, Version 2.0## (the "License"); you may not use this file except in compliance with## the License.  You may obtain a copy of the License at## ## http://www.apache.org/licenses/LICENSE-2.0## ## Unless required by applicable law or agreed to in writing, software## distributed under the License is distributed on an "AS IS" BASIS,## WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.## See the License for the specific language governing permissions and## limitations under the License.## ---------------------------------------------------------------------------# Defines credentials that will be used by components (like web console) to access the brokeractivemq.username=ljqactivemq.password=ljqguest.password=password

 

三、在Java生产者和消费者端设置用户名密码才能连接

ConnectionFactory connectionFactory = new ActiveMQConnectionFactory("ljq", "ljq", "failover:(tcp://localhost:61616)?Randomize=false");

 

转载地址:http://zvzol.baihongyu.com/

你可能感兴趣的文章
利用ST MCU内部的基准参考电压监测电源电压及其它
查看>>
MySQL 按指定字段自定义列表排序
查看>>
MySQL字段数据全部查出【只保留中文、英文、数字、空格的词表】
查看>>
svn 创建分支、切换分支 及 合并分支 操作
查看>>
[GIt] 团队工作效率分析工具gitstats
查看>>
写给新人的面向对象的基本思维
查看>>
关于分部视图(Partial View)
查看>>
DNS污染——domain name的解析被劫持了返回无效的ip
查看>>
一步一步写一个简单通用的makefile(二)
查看>>
sunspot使用
查看>>
Zombie.js Insanely fast, headless full-stack testing using Node.js
查看>>
POJ2406-Power Strings(kmp循环节)
查看>>
BCM路由全智能固件升级软件tftp,一键刷路由及常用固件下载
查看>>
个人认识:直接断电和发送复位信号给主板有啥区别?
查看>>
测试体会:WAYOS新架构(即二代QOS)的新功能解释
查看>>
UVA 10169 Urn-ball Probabilities !
查看>>
每日一例,练就编程高手
查看>>
no argument specified with option "/LIBPATH:"错误的解决【转载】
查看>>
初涉c#设计模式-Factory Pattern
查看>>
android 广播复杂参数
查看>>