<!-- Allows us to use system properties as variables in this configuration file --> <beanclass="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer"> <propertyname="locations"> <value>file:${activemq.conf}/credentials.properties</value> </property> </bean>
<!-- The <broker> element is used to configure the ActiveMQ broker. --> <brokerxmlns="http://activemq.apache.org/schema/core"brokerName="ShMQTest"dataDirectory="${activemq.data}">
<destinationPolicy> <policyMap> <policyEntries> <policyEntrytopic=">" > <!-- 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:
<!-- 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:
<!-- 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> <!-- 注释持久化默认适配器 Start --> <!-- Start <kahaDB directory="${activemq.data}/kahadb"/> End --> <!-- 注释持久化默认适配器 End -->
<!-- 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> <memoryUsagepercentOfJvmHeap="70" /> </memoryUsage> <storeUsage> <storeUsagelimit="10 gb"/> </storeUsage> <tempUsage> <tempUsagelimit="5 gb"/> </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 --> <transportConnectorname="openwire"uri="tcp://0.0.0.0:61616?maximumConnections=1000&wireFormat.maxFrameSize=104857600"/> <transportConnectorname="amqp"uri="amqp://0.0.0.0:5672?maximumConnections=1000&wireFormat.maxFrameSize=104857600"/> <transportConnectorname="stomp"uri="stomp://0.0.0.0:61613?maximumConnections=1000&wireFormat.maxFrameSize=104857600"/> <transportConnectorname="mqtt"uri="mqtt://0.0.0.0:1883?maximumConnections=1000&wireFormat.maxFrameSize=104857600"/> <transportConnectorname="ws"uri="ws://0.0.0.0:61614?maximumConnections=1000&wireFormat.maxFrameSize=104857600"/> </transportConnectors>
<!-- destroy the spring context on shutdown to stop jetty --> <shutdownHooks> <beanxmlns="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 --> <importresource="jetty.xml"/>