ActiveMQ的spring配置文件

Wesley13
• 阅读 536

从官网copy出来,做了部分修改:

  1 <?xml version="1.0" encoding="UTF-8"?>
  2 <beans xmlns="http://www.springframework.org/schema/beans" 
  3         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  4         xmlns:amq="http://activemq.apache.org/schema/core"
  5         xsi:schemaLocation="http://www.springframework.org/schema/beans 
  6         http://www.springframework.org/schema/beans/spring-beans.xsd   
  7         http://activemq.apache.org/schema/core 
  8         http://activemq.apache.org/schema/core/activemq-core.xsd">
  9         
 10 <!-- Allows us to use system properties as variables in this configuration file -->
 11 <!-- <bean class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer">
 12     <property name="locations">
 13         <value>file:${activemq.conf}/credentials.properties</value>
 14     </property>
 15 </bean> -->
 16 <!--
 17     The <broker> element is used to configure the ActiveMQ broker.
 18 -->
 19 <broker xmlns="http://activemq.apache.org/schema/core" brokerName="zhang" dataDirectory=".">
 20     <!--
 21             For better performances use VM cursor and small memory limit.
 22             For more information, see:
 23 
 24             http://activemq.apache.org/message-cursors.html
 25 
 26             Also, if your producer is "hanging", it's probably due to producer flow control.
 27             For more information, see:
 28             http://activemq.apache.org/producer-flow-control.html
 29     -->
 30     <destinationPolicy>
 31         <policyMap>
 32             <policyEntries>
 33                 <policyEntry topic=">" producerFlowControl="true">
 34                     <!-- The constantPendingMessageLimitStrategy is used to prevent
 35                          slow topic consumers to block producers and affect other consumers
 36                          by limiting the number of messages that are retained
 37                          For more information, see:
 38 
 39                          http://activemq.apache.org/slow-consumer-handling.html
 40 
 41                     -->
 42                     <pendingMessageLimitStrategy>
 43                         <constantPendingMessageLimitStrategy limit="1000"/>
 44                     </pendingMessageLimitStrategy>
 45                 </policyEntry>
 46                 <policyEntry queue=">" producerFlowControl="true" memoryLimit="1mb">
 47                 <!-- Use VM cursor for better latency
 48                        For more information, see:
 49 
 50                        http://activemq.apache.org/message-cursors.html
 51 
 52                   <pendingQueuePolicy>
 53                     <vmQueueCursor/>
 54                   </pendingQueuePolicy>
 55                   -->
 56                       <deadLetterStrategy>
 57                           <individualDeadLetterStrategy queuePrefix="TEST"/>
 58                     </deadLetterStrategy>
 59                     <pendingQueuePolicy>
 60                         <storeCursor/>
 61                     </pendingQueuePolicy>
 62                  </policyEntry>
 63             </policyEntries>
 64         </policyMap>
 65     </destinationPolicy>
 66     <!--
 67         The managementContext is used to configure how ActiveMQ is exposed in
 68         JMX. By default, ActiveMQ uses the MBean server that is started by
 69         the JVM. For more information, see:
 70 
 71         http://activemq.apache.org/jmx.html
 72     -->
 73     <managementContext>
 74         <managementContext createConnector="false"/>
 75     </managementContext>
 76     <!--
 77         Configure message persistence for the broker. The default persistence
 78         mechanism is the KahaDB store (identified by the kahaDB tag).
 79         For more information, see:
 80 
 81         http://activemq.apache.org/persistence.html
 82     -->
 83     <persistenceAdapter>
 84         <kahaDB directory="kahadb"/>
 85     </persistenceAdapter>
 86     <!--
 87     The systemUsage controls the maximum amount of space the broker will
 88     use before slowing down producers. For more information, see:
 89     http://activemq.apache.org/producer-flow-control.html
 90     If using ActiveMQ embedded - the following limits could safely be used:
 91 
 92     <systemUsage>
 93         <systemUsage>
 94             <memoryUsage>
 95             
 96                 <memoryUsage limit="20 mb"/>
 97             </memoryUsage>
 98             <storeUsage>
 99                 <storeUsage limit="1 gb"/>
100             </storeUsage>
101             <tempUsage>
102                 <tempUsage limit="100 mb"/>
103             </tempUsage>
104         </systemUsage>
105     </systemUsage>
106     -->
107     <systemUsage>
108         <systemUsage>
109             <memoryUsage>
110                 <memoryUsage limit="1 mb"/>
111             </memoryUsage>
112             <storeUsage>
113                 <storeUsage limit="32 mb"/>
114             </storeUsage>
115             <tempUsage>
116                 <tempUsage limit="32 mb"/>
117             </tempUsage>
118         </systemUsage>
119     </systemUsage>
120     <!--
121         The transport connectors expose ActiveMQ over a given protocol to
122         clients and other brokers. For more information, see:
123 
124         http://activemq.apache.org/configuring-transports.html
125     -->
126     <transportConnectors>
127     <!-- DOS protection, limit concurrent connections to 1000 and frame size to 100MB -->
128         <transportConnector name="openwire"
129         uri="tcp://0.0.0.0:61616?maximumConnections=1000"/>
130         <transportConnector name="amqp"
131         uri="amqp://0.0.0.0:5672?maximumConnections=1000"/>
132     </transportConnectors>
133     <!-- destroy the spring context on shutdown to stop jetty -->
134     <shutdownHooks>
135         <bean xmlns="http://www.springframework.org/schema/beans" class="org.apache.activemq.hooks.SpringContextHook"/>
136     </shutdownHooks>
137 </broker>
138 <!--
139         Enable web consoles, REST and Ajax APIs and demos
140 
141         Take a look at ${ACTIVEMQ_HOME}/conf/jetty.xml for more details
142 -->
143 <!-- <import resource="jetty.xml"/> -->
144 </beans>

 关于通配符的说明(http://activemq.apache.org/wildcards.html):

. is used to separate names in a path
* is used to match any name in a path
> is used to recursively match any destination starting from this name

点赞
收藏
评论区
推荐文章
blmius blmius
3年前
MySQL:[Err] 1292 - Incorrect datetime value: ‘0000-00-00 00:00:00‘ for column ‘CREATE_TIME‘ at row 1
文章目录问题用navicat导入数据时,报错:原因这是因为当前的MySQL不支持datetime为0的情况。解决修改sql\mode:sql\mode:SQLMode定义了MySQL应支持的SQL语法、数据校验等,这样可以更容易地在不同的环境中使用MySQL。全局s
待兔 待兔
4个月前
手写Java HashMap源码
HashMap的使用教程HashMap的使用教程HashMap的使用教程HashMap的使用教程HashMap的使用教程22
Easter79 Easter79
3年前
spring集成JMS activeMQ 头文件
<beansxmlns"http://www.springframework.org/schema/beans"xmlns:xsi"http://www.w3.org/2001/XMLSchemainstance"xmlns:amq"http://activemq.apache.org/schema/core"
Stella981 Stella981
3年前
Spring MVC 配置文件dispatcher
1.<?xmlversion\"1.0"encoding\"UTF8"?2.<beansxmlns\"http://www.springframework.org/schema/beans"3.xmlns:mvc\"http://www.springframework.org/schema/mvc"4.xml
Easter79 Easter79
3年前
Spring错误——Spring AOP——org.aspectj.weaver.reflect.ReflectionWorld$ReflectionWorldException
背景:学习切面,测试前置通知功能,xml配置如下<?xmlversion"1.0"encoding"UTF8"?<beansxmlns"http://www.springframework.org/schema/beans"xmlns:xsi"http:/
Wesley13 Wesley13
3年前
Spring中hibernateTemplate的使用
1.<?xmlversion\"1.0"encoding\"UTF8"?2.<beansxmlns\"http://www.springframework.org/schema/beans"3.xmlns:xsi\"http://www.w3.org/2001/XMLSchemainstance"xmlns:con
Stella981 Stella981
3年前
Redis在SSM框架的使用(三)
Spring整合springdataredis1、springredis.xml<?xmlversion"1.0"encoding"UTF8"?<beansxmlns"http://www.springframework.org/schema/beans"xmlns:xsi"http
Easter79 Easter79
3年前
Spring之级联属性
新建XML文件<?xmlversion"1.0"encoding"UTF8"?<beansxmlns"http://www.springframework.org/schema/beans"xmlns:xsi"http://www.w3.org/2001/XMLSchemainsta
Wesley13 Wesley13
3年前
MySQL部分从库上面因为大量的临时表tmp_table造成慢查询
背景描述Time:20190124T00:08:14.70572408:00User@Host:@Id:Schema:sentrymetaLast_errno:0Killed:0Query_time:0.315758Lock_
Python进阶者 Python进阶者
10个月前
Excel中这日期老是出来00:00:00,怎么用Pandas把这个去除
大家好,我是皮皮。一、前言前几天在Python白银交流群【上海新年人】问了一个Pandas数据筛选的问题。问题如下:这日期老是出来00:00:00,怎么把这个去除。二、实现过程后来【论草莓如何成为冻干莓】给了一个思路和代码如下:pd.toexcel之前把这