ACTIVEMQ主题、队列设置用户名密码
修改文件%ACTIVEMQ_BASE%/conf/activemq.xml,用户名密码储存在文件%ACTIVEMQ_BASE%/conf/credentials.properties中,
activemq.xml详细如下:
<!--
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.
-->
<!-- START SNIPPET: example -->
<beans
xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
http://activemq.apache.org/schema/core http://activemq.apache.org/schema/core/activemq-core.xsd">
<!-- Allows us to use system properties as variables in this configuration file -->
<bean class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer">
<property name="locations">
<value>file:${activemq.conf}/credentials.properties</value>
</property>
</bean>
<!-- Allows log searching in hawtio console -->
<bean id="logQuery" class="org.fusesource.insight.log.log4j.Log4jLogQuery"
lazy-init="false" scope="singleton"
init-method="start" destroy-method="stop">
</bean>
<!--
The <broker> element is used to configure the ActiveMQ broker.
-->
<broker xmlns="http://activemq.apache.org/schema/core" brokerName="localhost" dataDirectory="${activemq.data}" useJmx="true">
<destinationPolicy>
<policyMap>
<policyEntries>
<policyEntry queue=">" producerFlowControl="true" memoryLimit="1mb">
<!-- The constantPendingMessageLimitStrategy is used to prevent
slow topic consumers to block producers and affect other consumers
by limiting the number of messages that are retained
For more information, see:
http://activemq.apache.org/slow-consumer-handling.html
-->
<!-- 分发策略 -->
<dispatchPolicy>
<!-- 按顺序分发 -->
<strictOrderDispatchPolicy/>
</dispatchPolicy>
<!-- 恢复策略-->
<subscriptionRecoveryPolicy>
<!-- 只恢复最后一个message -->
<lastImageSubscriptionRecoveryPolicy/>
</subscriptionRecoveryPolicy>
<pendingQueuePolicy>
<!-- 首先在内存中保存消息的引用,如果内存使用量达到上限,那么会把消息引用保存到临时文件中 -->
<fileQueueCursor/>
</pendingQueuePolicy>
<pendingMessageLimitStrategy>
<constantPendingMessageLimitStrategy limit="1000"/>
</pendingMessageLimitStrategy>
</policyEntry>
<!-- 个人简历 -->
<policyEntry queue="PER.>" producerFlowControl="true" memoryLimit="10mb">
<!-- The constantPendingMessageLimitStrategy is used to prevent
slow topic consumers to block producers and affect other consumers
by limiting the number of messages that are retained
For more information, see:
http://activemq.apache.org/slow-consumer-handling.html
-->
<!-- 分发策略 -->
<dispatchPolicy>
<!-- 按顺序分发 -->
<strictOrderDispatchPolicy/>
</dispatchPolicy>
<!-- 恢复策略-->
<subscriptionRecoveryPolicy>
<!-- 只恢复最后一个message -->
<lastImageSubscriptionRecoveryPolicy/>
</subscriptionRecoveryPolicy>
<pendingQueuePolicy>
<!-- 首先在内存中保存消息的引用,如果内存使用量达到上限,那么会把消息引用保存到临时文件中 -->
<fileQueueCursor/>
</pendingQueuePolicy>
<pendingMessageLimitStrategy>
<constantPendingMessageLimitStrategy limit="1000"/>
</pendingMessageLimitStrategy>
</policyEntry>
<!-- 企业 -->
<policyEntry queue="COM.>" producerFlowControl="true" memoryLimit="10mb">
<!-- The constantPendingMessageLimitStrategy is used to prevent
slow topic consumers to block producers and affect other consumers
by limiting the number of messages that are retained
For more information, see:
http://activemq.apache.org/slow-consumer-handling.html
-->
<!-- 分发策略 -->
<dispatchPolicy>
<!-- 按顺序分发 -->
<strictOrderDispatchPolicy/>
</dispatchPolicy>
<!-- 恢复策略-->
<subscriptionRecoveryPolicy>
<!-- 只恢复最后一个message -->
<lastImageSubscriptionRecoveryPolicy/>
</subscriptionRecoveryPolicy>
<pendingQueuePolicy>
<!-- 首先在内存中保存消息的引用,如果内存使用量达到上限,那么会把消息引用保存到临时文件中 -->
<fileQueueCursor/>
</pendingQueuePolicy>
<pendingMessageLimitStrategy>
<constantPendingMessageLimitStrategy limit="1000"/>
</pendingMessageLimitStrategy>
</policyEntry>
<!-- 招聘会 -->
<policyEntry queue="RECR.>" producerFlowControl="true" memoryLimit="10mb">
<!-- The constantPendingMessageLimitStrategy is used to prevent
slow topic consumers to block producers and affect other consumers
by limiting the number of messages that are retained
For more information, see:
http://activemq.apache.org/slow-consumer-handling.html
-->
<!-- 分发策略 -->
<dispatchPolicy>
<!-- 按顺序分发 -->
<strictOrderDispatchPolicy/>
</dispatchPolicy>
<!-- 恢复策略-->
<subscriptionRecoveryPolicy>
<!-- 只恢复最后一个message -->
<lastImageSubscriptionRecoveryPolicy/>
</subscriptionRecoveryPolicy>
<pendingQueuePolicy>
<!-- 首先在内存中保存消息的引用,如果内存使用量达到上限,那么会把消息引用保存到临时文件中 -->
<fileQueueCursor/>
</pendingQueuePolicy>
<pendingMessageLimitStrategy>
<constantPendingMessageLimitStrategy limit="1000"/>
</pendingMessageLimitStrategy>
</policyEntry>
<!-- 微招聘 -->
<policyEntry queue="MCOM.>" producerFlowControl="true" memoryLimit="10mb">
<!-- The constantPendingMessageLimitStrategy is used to prevent
slow topic consumers to block producers and affect other consumers
by limiting the number of messages that are retained
For more information, see:
http://activemq.apache.org/slow-consumer-handling.html
-->
<!-- 分发策略 -->
<dispatchPolicy>
<!-- 按顺序分发 -->
<strictOrderDispatchPolicy/>
</dispatchPolicy>
<!-- 恢复策略-->
<subscriptionRecoveryPolicy>
<!-- 只恢复最后一个message -->
<lastImageSubscriptionRecoveryPolicy/>
</subscriptionRecoveryPolicy>
<pendingQueuePolicy>
<!-- 首先在内存中保存消息的引用,如果内存使用量达到上限,那么会把消息引用保存到临时文件中 -->
<fileQueueCursor/>
</pendingQueuePolicy>
<pendingMessageLimitStrategy>
<constantPendingMessageLimitStrategy limit="1000"/>
</pendingMessageLimitStrategy>
</policyEntry>
<!-- 微求职 -->
<policyEntry queue="MPER.>" producerFlowControl="true" memoryLimit="10mb">
<!-- The constantPendingMessageLimitStrategy is used to prevent
slow topic consumers to block producers and affect other consumers
by limiting the number of messages that are retained
For more information, see:
http://activemq.apache.org/slow-consumer-handling.html
-->
<!-- 分发策略 -->
<dispatchPolicy>
<!-- 按顺序分发 -->
<strictOrderDispatchPolicy/>
</dispatchPolicy>
<!-- 恢复策略-->
<subscriptionRecoveryPolicy>
<!-- 只恢复最后一个message -->
<lastImageSubscriptionRecoveryPolicy/>
</subscriptionRecoveryPolicy>
<pendingQueuePolicy>
<!-- 首先在内存中保存消息的引用,如果内存使用量达到上限,那么会把消息引用保存到临时文件中 -->
<fileQueueCursor/>
</pendingQueuePolicy>
<pendingMessageLimitStrategy>
<constantPendingMessageLimitStrategy limit="1000"/>
</pendingMessageLimitStrategy>
</policyEntry>
<!-- 后台 -->
<policyEntry queue="ERP.>" producerFlowControl="true" memoryLimit="10mb">
<!-- The constantPendingMessageLimitStrategy is used to prevent
slow topic consumers to block producers and affect other consumers
by limiting the number of messages that are retained
For more information, see:
http://activemq.apache.org/slow-consumer-handling.html
-->
<!-- 分发策略 -->
<dispatchPolicy>
<!-- 按顺序分发 -->
<strictOrderDispatchPolicy/>
</dispatchPolicy>
<!-- 恢复策略-->
<subscriptionRecoveryPolicy>
<!-- 只恢复最后一个message -->
<lastImageSubscriptionRecoveryPolicy/>
</subscriptionRecoveryPolicy>
<pendingQueuePolicy>
<!-- 首先在内存中保存消息的引用,如果内存使用量达到上限,那么会把消息引用保存到临时文件中 -->
<fileQueueCursor/>
</pendingQueuePolicy>
<pendingMessageLimitStrategy>
<constantPendingMessageLimitStrategy limit="1000"/>
</pendingMessageLimitStrategy>
</policyEntry>
</policyEntries>
</policyMap>
</destinationPolicy>
<!--
The managementContext is used to configure how ActiveMQ is exposed in
JMX. By default, ActiveMQ uses the MBean server that is started by
the JVM. For more information, see:
http://activemq.apache.org/jmx.html
-->
<managementContext>
<managementContext createConnector="false"/>
</managementContext>
<!--
Configure message persistence for the broker. The default persistence
mechanism is the KahaDB store (identified by the kahaDB tag).
For more information, see:
http://activemq.apache.org/persistence.html
-->
<persistenceAdapter>
<kahaDB directory="E:/activemq_data"
enableJournalDiskSyncs="false"
indexWriteBatchSize="1000"
indexCacheSize="10000"
journalMaxFileLength="32mb"
/>
</persistenceAdapter>
<plugins>
<!-- Configure authentication; Username, passwords and groups -->
<simpleAuthenticationPlugin>
<users>
<authenticationUser username="${activemq.username}" password="${activemq.password}" groups="admins"/>
<authenticationUser username="${per.username}" password="${per.password}" groups="personal"/>
<authenticationUser username="${mper.username}" password="${mper.password}" groups="mpersonal"/>
<authenticationUser username="${com.username}" password="${com.password}" groups="company"/>
<authenticationUser username="${mcom.username}" password="${mcom.password}" groups="mcompany"/>
<authenticationUser username="${erp.username}" password="${erp.password}" groups="erp"/>
<authenticationUser username="${recr.username}" password="${recr.password}" groups="recr"/>
</users>
</simpleAuthenticationPlugin>
<!-- Lets configure a destination based authorization mechanism -->
<authorizationPlugin>
<map>
<authorizationMap>
<authorizationEntries>
<authorizationEntry queue=">" read="admins" write="admins" admin="admins" />
<authorizationEntry queue="PER.>" read="personal, mpersonal, company, mcompany, erp, recr" write="personal" admin="personal" />
<authorizationEntry queue="MPER.>" read="personal, mpersonal, company, mcompany, erp, recr" write="mpersonal" admin="mpersonal" />
<authorizationEntry queue="COM.>" read="personal, mpersonal, company, mcompany, erp, recr" write="company" admin="company" />
<authorizationEntry queue="MCOM.>" read="personal, mpersonal, company, mcompany, erp, recr" write="mcompany" admin="mcompany" />
<authorizationEntry queue="ERP.>" read="personal, mpersonal, company, mcompany, erp, recr" write="erp" admin="erp" />
<authorizationEntry queue="RECR.>" read="personal, mpersonal, company, mcompany, erp, recr" write="recr" admin="recr" />
<authorizationEntry topic="ActiveMQ.Advisory.>" read="personal, mpersonal, company, mcompany, erp, recr" write="personal, mpersonal, company, mcompany, erp, recr" admin="personal, mpersonal, company, mcompany, erp, recr" />
</authorizationEntries>
</authorizationMap>
</map>
</authorizationPlugin>
</plugins>
<!--
The systemUsage controls the maximum amount of space the broker will
use before disabling caching and/or slowing down producers. For more information, see:
http://activemq.apache.org/producer-flow-control.html
-->
<systemUsage>
<systemUsage>
<memoryUsage>
<memoryUsage percentOfJvmHeap="100" />
</memoryUsage>
<storeUsage>
<storeUsage limit="1 gb"/>
</storeUsage>
<tempUsage>
<tempUsage limit="100 mb"/>
</tempUsage>
</systemUsage>
</systemUsage>
<!--
The transport connectors expose ActiveMQ over a given protocol to
clients and other brokers. For more information, see:
http://activemq.apache.org/configuring-transports.html
-->
<transportConnectors>
<!-- DOS protection, limit concurrent connections to 1000 and frame size to 100MB -->
<transportConnector name="openwire" uri="tcp://0.0.0.0:61616?maximumConnections=1000&wireFormat.maxFrameSize=104857600"/>
<transportConnector name="amqp" uri="amqp://0.0.0.0:5672?maximumConnections=1000&wireFormat.maxFrameSize=104857600"/>
<transportConnector name="stomp" uri="stomp://0.0.0.0:61613?maximumConnections=1000&wireFormat.maxFrameSize=104857600"/>
<transportConnector name="mqtt" uri="mqtt://0.0.0.0:1883?maximumConnections=1000&wireFormat.maxFrameSize=104857600"/>
<transportConnector name="ws" uri="ws://0.0.0.0:61614?maximumConnections=1000&wireFormat.maxFrameSize=104857600"/>
</transportConnectors>
<!-- destroy the spring context on shutdown to stop jetty -->
<shutdownHooks>
<bean xmlns="http://www.springframework.org/schema/beans" class="org.apache.activemq.hooks.SpringContextHook" />
</shutdownHooks>
</broker>
<!--
Enable web consoles, REST and Ajax APIs and demos
The web consoles requires by default login, you can disable this in the jetty.xml file
Take a look at ${ACTIVEMQ_HOME}/conf/jetty.xml for more details
-->
<import resource="jetty.xml"/>
</beans>
<!-- END SNIPPET: example -->
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=***
activemq.password=***
per.username=***
per.password=***
mper.username=***
mper.password=***
com.username=***
com.password=***
mcom.username=***
mcom.password=***
erp.username=***
erp.password=***
recr.username=***
recr.password=***
以上配置今天发现队列监控出现异常,最后查到问题出现在这里:
由于队列监控项目admin里使用的账户为system/manager(webapps\admin\WEB-INF\webconsole-embedded.xml
),属于admins群组,需要加上权限。
ACTIVEMQ主题、队列设置用户名密码的更多相关文章
- windows下mongodb设置用户名密码&用python连接
环境: 主机:WIN10 python版本:3.5 mongodb版本:3.4.2 开发环境:pyCharm mongodb设置用户名密码: 编写mongodb配置文件mongodb.confdbpa ...
- 你的MongoDB Redis设置用户名密码了吗?看看shodan这款邪恶的搜索引擎吧!~
早上看新闻的时候看到了个醒目的新闻 开源中国:MongoDB 赎金事件持续发酵,究竟是谁之过? 博客园:MongoDB数据库勒索,中国受害者数量超乎你的想象,SOS! 1. 由于自己之前做过的项目,R ...
- ElasticSearch设置用户名密码访问
版本号:7.3.1 1.需要在配置文件中开启x-pack验证, 修改config目录下面的elasticsearch.yml文件,在里面添加如下内容,并重启. xpack.security.enabl ...
- eureka注册中心设置用户名密码
1.加入安全认证依赖 <dependency> <groupId>org.springframework.boot</groupId> <artifactId ...
- 创建一个MongoDB数据库再到配置成Window服务再设置用户名密码
1.安装MongoDB数据在官网下载安装 然后在C盘找到C:\Program Files\MongoDB\Server\4.0\bin这个可执行目录 使用cmd进入到这: 2.在C盘根目录创建一个名为 ...
- ActiveMQ修改连接的用户名密码
安装目录下conf/activemq.xml 添加如下内容: <plugins> <simpleAuthenticationPlugin> <users> < ...
- mongodb3 设置用户名密码 ,linux
--29T09:: I CONTROL [initandlisten] ** WARNING: You are running on a NUMA machine. --29T09:: I CONTR ...
- 不同版本的 Tomcat 设置用户名密码 的方法
Tomcat : tomcat根目录\conf\tomcat-users.xml,找到 <tomcat-users> 标签,在后面添加 <user username="ad ...
- ActiveMQ安全机制设置
一.设置后台管理密码a.ActiveMQ使用的是jetty服务器,找到D:\div\apache-activemq-5.11.1\conf\jetty.xml文件: <bean id=" ...
随机推荐
- laravel数据库操作
一.配置文件路径:/.env DB_CONNECTION=mysql DB_HOST=127.0.0.1 DB_PORT= DB_DATABASE=test DB_USERNAME=root DB_P ...
- Ubuntu 网卡多个 IP 地址
临时添加 IP 地址 首先,让我们找到网卡的 IP 地址.在我的 Ubuntu 15.10 服务器版中,我只使用了一个网卡. 运行下面的命令找到 IP 地址: 复制代码 代码如下: sudo ip a ...
- how to enable the Accessibility in the app
第一部分 先要装一个accchecker,全称是 UI Accessibility Checker .下载地址: http://acccheck.codeplex.com/ 装了之后 用这个工具可以 ...
- 面向对象先修:Java入门
学习总结 在C语言和数据结构的基础上,在上暑期的面向对象Java先修课程时,熟悉语言的速度明显加快了很多.Java和C在很多基础语法上非常相似,比如基本的数据类型,循环以及条件分支语句,数组的遍历等. ...
- 2018.10.15 bzoj4445: [Scoi2015]小凸想跑步(半平面交)
传送门 话说去年的省选计算几何难度跟前几年比起来根本不能做啊(虽然去年考的时候并没有学过计算几何) 这题就是推个式子然后上半平面交就做完了. 什么? 怎么推式子? 先把题目的概率转换成求出可行区域. ...
- htoi的实现
htoi的实现 /************************************************************************* > File Name: h ...
- 51Nod 1376 最长递增子序列的数量 (DP+BIT)
题意:略. 析:dp[i] 表示以第 i 个数结尾的LIS的长度和数量,状态方程很好转移,先说长度 dp[i] = max { dp[j] + 1 | a[i] > a[j] && ...
- UVa 11491 Erasing and Winning (贪心,单调队列或暴力)
题意:给一个数字(开头非0),拿掉其中的d个数字,使剩下的数字最大(前后顺序不能变). 析:拿掉d个数字,还剩下n-d个数字.相当于从n个数字中按先后顺序选出n-d个数字使组成的数字最大,当然采用窗口 ...
- 用eclipse创建maven的webapp项目
来自http://www.cnblogs.com/candle806/p/3439469.html和http://blog.csdn.net/chuyuqing/article/details/288 ...
- 8b10b
目的:保持直流平衡DC Balance). running disparity() 8bit原始数据会分成两部分,其低5位会进行5B/6B编码,高3位则进行3B/4B编码,这两种映射关系在当时已经成为 ...