ActiveMQ——XML配置文件
来源:互联网 发布:网络教育文凭毕业证 编辑:程序博客网 时间:2024/06/06 00:59
XML配置文件
n 由端口通道和wire格式组成的端口连接器的说明:增加一个链接页说明端口连接器是如何配置的、如何使用的。
n 由网络通道和发现组成的网络连接器说明:增加一个链接页面说明网络连接器是如何配置和使用的。
n 发现代理说明:增加一个链接页面说明发现代理如何配置和使用的。
n 持久化提供者和定位说明:增加一个链接页面说明持久化提供者如何配置和使用的。
n 自定义消息容器(例如缓存的最后一个图形)。
我们使用XBean来执行XML配置。
关于XML配置的详细信息请查看XML参考。
注意代理名和URI:确保你没有使用一些奇怪的字符来定义代理名称。当他们被转换为URI时,会不允许使用下划线之类的字符。
示例:
缺省的ActiveMQ配置:当前缺省的配置
<beans
xmlns="http://www.springframework.org/schema/beans"
xmlns:amq="http://activemq.apache.org/schema/core"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.springframework.org/schema/beanshttp://www.springframework.org/schema/beans/spring-beans-2.0.xsd
http://activemq.apache.org/schema/corehttp://activemq.apache.org/schema/core/activemq-core.xsd">
<!-- Allows us to use system properties as variables in thisconfiguration file -->
<beanclass="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer">
<property name="locations">
<value>file:${activemq.base}/conf/credentials.properties</value>
</property>
</bean>
<!--
The <broker> element is used to configure the ActiveMQ broker.
-->
<broker xmlns="http://activemq.apache.org/schema/core"brokerName="localhost"dataDirectory="${activemq.base}/data">
<!--
Forbetter performances use VM cursor and small memory limit.
Formore information, see:
http://activemq.apache.org/message-cursors.html
Also, if your producer is "hanging", it's probably due toproducer flow control.
For more information, see:
http://activemq.apache.org/producer-flow-control.html
-->
<destinationPolicy>
<policyMap>
<policyEntries>
<policyEntrytopic=">" producerFlowControl="true"memoryLimit="1mb">
<pendingSubscriberPolicy>
<vmCursor />
</pendingSubscriberPolicy>
</policyEntry>
<policyEntryqueue=">" producerFlowControl="true"memoryLimit="1mb">
<!-- Use VM cursor forbetter latency
For more information,see:
http://activemq.apache.org/message-cursors.html
<pendingQueuePolicy>
<vmQueueCursor/>
</pendingQueuePolicy>
-->
</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="${activemq.base}/data/kahadb"/>
</persistenceAdapter>
<!--
The systemUsage controls the maximum amount of space the broker will
use before slowing down producers. For more information, see:
http://activemq.apache.org/producer-flow-control.html
<systemUsage>
<systemUsage>
<memoryUsage>
<memoryUsagelimit="20 mb"/>
</memoryUsage>
<storeUsage>
<storeUsagelimit="1 gb"/>
</storeUsage>
<tempUsage>
<tempUsagelimit="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>
<transportConnector name="openwire" uri="tcp://0.0.0.0:61616"/>
</transportConnectors>
</broker>
<!--
Enable web consoles, REST and Ajax APIs and demos
Take a look at ${ACTIVEMQ_HOME}/conf/jetty.xml for more details
-->
<import resource="jetty.xml"/>
</beans>
可执行文件的发行版有一个activemq脚本允许你从命令行来运行来运行消息代理,此代理作为一个独立的进程,在此之前你只需配置PATH的$ACTIVEMQ_HOME/bin目录。
配置嵌入式代理
你可以使用XML文件来配置嵌入式代理。例如使用JNDI配置原理,查看BrokerXmlConfigFromJNDITest这个示例。
或者通过java代码来显式的配置嵌入式代理,请查阅BrokerXmlConfigTest示例。
用户提交配置
我们有一个页面允许用户提交来提交配置的信息。
n 用户提交配置
背景
ActiveMQ有如此多的策略模板插件提供给端口、wire格式、持久化和其他的许多事情,我们希望保持配置格式开放,以便你可以配置和任何方向的扩展。
所以我们使用SpringXml配置文件格式,它允许beans/POJOs一起工作和配置。可是Spring的XML通常很长,以至我们实现ActiveMQ扩展到Spring XML中,你可以只知道最常用的,标准的ActiveMQ的配置(例如连接器、wire格式、服务器端口和持久化的标志),而不需要求助于如何使用Spring的方法(例如bean、property标志)。
如何使用和访问XSD/DTD的XML文件的文档请查看XML参考。- ActiveMQ——XML配置文件
- ActiveMQ XML配置文件
- ActiveMQ——XML参考
- struts2配置文件—struts.xml
- ActiveMQ系列—ActiveMQ安装
- xml——配置文件的基本使用
- 应用程序——INI和XML配置文件
- Struts2的配置文件——struts.xml
- Struts2配置文件详解——struts.xml
- Struts2的配置文件——web.xml
- 应用程序——INI和XML配置文件
- Struts2的配置文件——web.xml
- Struts2的配置文件——web.xml
- Tomcat配置文件——server.xml(1)
- Tomcat配置文件——server.xml(2)
- Tomcat配置文件——server.xml(3)
- Tomcat配置文件——server.xml(4)
- Tomcat配置文件——server.xml(5)
- 算法学习心得——动态规划法实现最长公共子序列(LCS)
- ActiveMQ——如何监控ActiveMQ
- 分析opencv的图像输入\出基本框架
- js 跟php服务端交互 <script language=\"javascript\" src=\"test.php?step=2&rnd={$timestamp}
- 调试介绍
- ActiveMQ——XML配置文件
- java NIO札记 .
- Qt 程序在 windows 下的发布
- Oracle 单实例 从32位 迁移到 64位 方法(一)-- 直接 copy datafiles
- ActiveMQ——XML参考
- 雷军的宿命
- 清除系统垃圾文件Batch处理
- jquery判断checkbox是否选中
- 性能测试指标及常用的监控工具