一、设置后台管理密码
a、ActiveMQ使用的是jetty服务器,找到D:\div\apache-activemq-5.11.1\conf\jetty.xml文件:

<bean id="adminSecurityConstraint" class="org.eclipse.jetty.util.security.Constraint">
<property name="name" value="BASIC" />
<property name="roles" value="admin" />
<!-- set authenticate=false to disable login -->
<property name="authenticate" value="true" />
</bean>

注意:低版本的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, user
ljq: 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 broker activemq.username=ljq
activemq.password=ljq
guest.password=password

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

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

ActiveMQ安全机制设置的更多相关文章

  1. 深入浅出 JMS(三) - ActiveMQ 安全机制

    深入浅出 JMS(三) - ActiveMQ 安全机制 一.认证 认证(Authentication):验证某个实体或者用户是否有权限访问受保护资源. MQ 提供两种插件用于权限认证: (一).Sim ...

  2. 消息中间件-activemq消息机制和持久化介绍(三)

    前面一节简单学习了activemq的使用,我们知道activemq的使用方式非常简单有如下几个步骤: 创建连接工厂 创建连接 创建会话 创建目的地 创建生产者或消费者 生产或消费消息 关闭生产或消费者 ...

  3. ActiveMQ持久化机制和JMS可靠消息

    1.ActiveMQ持久化机制 1.1 JDBC将数据持久化到数据库 1.2 AMQ生成日志文件 1.3 KahaDB:本次磁盘生成数据文件(默认) 1.4 LevelDB:谷歌K/V数据库 1.5 ...

  4. 消息中间件-activemq安全机制

    activemq作为消息中间件这样一个独立的个体存在,连通用户和服务器.如果没有一套完备的安全机制去设置用户权限设置消息分发机制可想后果是非常严重.ActiveMQ如果不加入安全机制的话,任何人只要知 ...

  5. tomcat,zookeeper,activeMQ,Kafka设置jvm参数

    1,tomcat设置jvm参数 设置方法:   在tomcat bin 目录增加配置:setenv.sh   #add tomcat pid CATALINA_PID="$CATALINA_ ...

  6. ActiveMQ中Session设置的相关理解

    名词解释: P:生产者 C:消费者 服务端:P 或者 ActiveMQ服务 客户端:ActiveMQ服务 或者 C 客户端成功接收一条消息的标志是这条消息被签收.成功接收一条消息一般包括如下三个阶段: ...

  7. ActiveMQ可靠性机制

    消息的签收(Acknowledgment): 客户端成功接收一条消息的标志是这条消息被签收. 成功接收一条消息一般包括如下三个阶段: (1) 客户端接收消息  (2) 客户端处理消息   (3) 消息 ...

  8. ActiveMQ 用户名密码设置

    用户名密码信息保存在conf/jetty-realm.properties文件中 按顺序分别是:用户名.密码.角色名 另:ActiveMQ使用的是jetty服务器, 可以通过设置conf/jetty. ...

  9. ActiveMQ持久化机制

    用户注册成功后发短信提醒 同步http 异步mq JMS中两种通讯模式: 发布订阅   一对多  topic   去过消费者集群的话 都会消费 消息队列   点对点 queue  去过消费者集群的话 ...

随机推荐

  1. CDialog类

    CDilalog包含三个关键函数:OnInitDialog.OnOK和OnCancel,可以覆盖这三个函数初始化对话框.响应点击OK和Cancel按钮.尽管每个函数都响应一条对话框消息,但是不需要你提 ...

  2. python关键的语法

    python关键的语法 1.标准类型分类

  3. SoC FPGA开发板的FPGA配置数据下载和固化

    小梅哥编写,未经许可,严禁用于任何商业用途 2018年7月2日星期一  soc fpga的烧写和固化方式与传统的纯fpga固化方式即存在形式上的相同,也存在细节上的差异,特整理此文. AC501-So ...

  4. hdu 5018

    http://acm.hdu.edu.cn/showproblem.php?pid=5018 任意给你三个数,让你判断第三个数是否在以前两个数为开头组成的Fibonacci 数列中. 直接暴力 #in ...

  5. JProfiler 简要使用说明

    1.简介 JProfiler是一个ALL-IN-ONE的JAVA剖析工具,可以方便地监控Java程序的CPU.内存使用状况,能够检查垃圾回收.分析性能瓶颈. 本说明文档基于JProfiler 9.2编 ...

  6. delphi 6数据库连接之长短模式(sqlserver)

    delphi 6数据库连接之长短模式(sqlserver) 标签: delphi数据库 2015-08-12 20:59 351人阅读 评论(0) 收藏 举报  分类: delphi(3)  版权声明 ...

  7. 【Win2D】【译】Win2D 快速入门

    原文链接:http://microsoft.github.io/Win2D/html/QuickStart.htm 快速入门 这是 Win2D 的快速入门教程,将会介绍 Win2D 中的基本功能.你将 ...

  8. LeetCode140:Word Break II

    题目: Given a string s and a dictionary of words dict, add spaces in s to construct a sentence where e ...

  9. Restframework 渲染器 render 组件实例-4

    渲染器默认存放位置: 在默认配置下 default-settings里 (APIVIEW点击去--> 1. renderer_classes = api_settings.DEFAULT_REN ...

  10. 字符串(tjoi2016,heoi2016,bzoj4556)(sam(后缀自动机)+线段树合并+倍增+二分答案)

    佳媛姐姐过生日的时候,她的小伙伴从某东上买了一个生日礼物.生日礼物放在一个神奇的箱子中.箱子外边写了 一个长为\(n\)的字符串\(s\),和\(m\)个问题.佳媛姐姐必须正确回答这\(m\)个问题, ...