ActiveMQ配置文件
credentials.properties
<bean class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer">
<property name="locations">
<value>file:${activemq.conf}/credentials.properties</value>
</property>
</bean>
允许我们使用系统属性当作变量在这个配置文件中(credentials.properties)如下:
activemq.username=system
activemq.password=manager
guest.password=password
logQuery
<!-- Allows accessing the server log -->
<bean id="logQuery" class="io.fabric8.insight.log.log4j.Log4jLogQuery"
lazy-init="false" scope="singleton"
init-method="start" destroy-method="stop">
</bean>
允许我们接触到服务器日志,单例模式
Broker 配置
<broker xmlns="http://activemq.apache.org/schema/core" brokerName="localhost" dataDirectory="${activemq.data}" schedulerSupport="true" persistent="true" useShutdownHook="false" splitSystemUsageForProducersConsumers="true" producerSystemUsagePortion="50" consumerSystemUsagePortion="50" useJmx="true" schedulePeriodForDestinationPurge="86400000">
生产上配置如上,逐个解释作用:
- xmlns: 定义一个或者多个命名空间
- brokerName: 设置broker的名字,如果想当作单独的broker,必须是唯一的名字
- dataDirectory: 默认的存储持久化数据的目录
- schedulerSupport:开启延时投递
- persistent