Advertisement
Guest User

Untitled

a guest
Sep 19th, 2014
229
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
XML 6.01 KB | None | 0 0
  1. <!--
  2.    Licensed to the Apache Software Foundation (ASF) under one or more
  3.    contributor license agreements.  See the NOTICE file distributed with
  4.    this work for additional information regarding copyright ownership.
  5.    The ASF licenses this file to You under the Apache License, Version 2.0
  6.    (the "License"); you may not use this file except in compliance with
  7.    the License.  You may obtain a copy of the License at
  8.  
  9.    http://www.apache.org/licenses/LICENSE-2.0
  10.  
  11.    Unless required by applicable law or agreed to in writing, software
  12.    distributed under the License is distributed on an "AS IS" BASIS,
  13.    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  14.    See the License for the specific language governing permissions and
  15.    limitations under the License.
  16. -->
  17. <!-- START SNIPPET: example -->
  18. <beans
  19.  xmlns="http://www.springframework.org/schema/beans"
  20.  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  21.  xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
  22.  http://activemq.apache.org/schema/core http://activemq.apache.org/schema/core/activemq-core.xsd">
  23.  
  24.     <!-- Allows us to use system properties as variables in this configuration file -->
  25.     <bean class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer">
  26.         <property name="locations">
  27.             <value>file:${activemq.conf}/credentials.properties</value>
  28.         </property>
  29.     </bean>
  30.  
  31.    <!-- Allows accessing the server log -->
  32.     <!--
  33.    <bean id="logQuery" class="org.fusesource.insight.log.log4j.Log4jLogQuery"
  34.          lazy-init="false" scope="singleton"
  35.          init-method="start" destroy-method="stop">
  36.    </bean>
  37.    -->
  38.  
  39.     <!--
  40.        The <broker> element is used to configure the ActiveMQ broker.
  41.    -->
  42.     <broker xmlns="http://activemq.apache.org/schema/core"
  43.            brokerName="{{ansible_hostname}}.{{ansible_domain}}"
  44.            enableStatistics="true"
  45.            persistent="true"
  46.            schedulerSupport="true"
  47.            useJmx="true"
  48.            schedulePeriodForDestinationPurge="60000"
  49.            dataDirectory="${activemq.data}">
  50.  
  51.         <destinationPolicy>
  52.             <policyMap>
  53.               <policyEntries>
  54.                 <policyEntry queue=">"
  55.                              advisoryForConsumed="true"
  56.                              gcInactiveDestinations="true"
  57.                              inactiveTimoutBeforeGC="60000">
  58.                     <!-- The constantPendingMessageLimitStrategy is used to prevent
  59.                         slow topic consumers to block producers and affect other consumers
  60.                         by limiting the number of messages that are retained
  61.                         For more information, see:
  62.  
  63.                         http://activemq.apache.org/slow-consumer-handling.html
  64.  
  65.                    -->
  66.                   <pendingMessageLimitStrategy>
  67.                     <constantPendingMessageLimitStrategy limit="1000"/>
  68.                   </pendingMessageLimitStrategy>
  69.                 </policyEntry>
  70.               </policyEntries>
  71.             </policyMap>
  72.         </destinationPolicy>
  73.  
  74.  
  75.         <!--
  76.            Configure message persistence for the broker. The default persistence
  77.            mechanism is the KahaDB store (identified by the kahaDB tag).
  78.            For more information, see:
  79.  
  80.            http://activemq.apache.org/persistence.html
  81.        -->
  82.         <persistenceAdapter>
  83.  
  84.             <!-- <kahaDB directory="${activemq.data}/kahadb"/> -->
  85.  
  86.             <levelDB directory="${activemq.data}/leveldb"/>
  87.  
  88.         </persistenceAdapter>
  89.  
  90.  
  91.           <!--
  92.            The systemUsage controls the maximum amount of space the broker will
  93.            use before disabling caching and/or slowing down producers. For more information, see:
  94.            http://activemq.apache.org/producer-flow-control.html
  95.          -->
  96.           <systemUsage>
  97.             <systemUsage>
  98.                 <memoryUsage>
  99.                     <memoryUsage percentOfJvmHeap="70" />
  100.                 </memoryUsage>
  101.                 <storeUsage>
  102.                     <storeUsage limit="100 gb"/>
  103.                 </storeUsage>
  104.                 <tempUsage>
  105.                     <tempUsage limit="1 gb"/>
  106.                 </tempUsage>
  107.             </systemUsage>
  108.         </systemUsage>
  109.  
  110.         <!--
  111.            The transport connectors expose ActiveMQ over a given protocol to
  112.            clients and other brokers. For more information, see:
  113.  
  114.            http://activemq.apache.org/configuring-transports.html
  115.        -->
  116.         <transportConnectors>
  117.             <!-- DOS protection, limit concurrent connections to 1000 and frame size to 100MB -->
  118.             <transportConnector name="openwire" uri="tcp://0.0.0.0:61616?maximumConnections=1000&amp;wireFormat.maxFrameSize=104857600"/>
  119.             <transportConnector name="amqp" uri="amqp://0.0.0.0:5672?maximumConnections=1000&amp;wireFormat.maxFrameSize=104857600"/>
  120.             <transportConnector name="stomp" uri="stomp://0.0.0.0:61613?maximumConnections=1000&amp;wireFormat.maxFrameSize=104857600"/>
  121.             <transportConnector name="mqtt" uri="mqtt://0.0.0.0:1883?maximumConnections=1000&amp;wireFormat.maxFrameSize=104857600"/>
  122.             <transportConnector name="ws" uri="ws://0.0.0.0:61614?maximumConnections=1000&amp;wireFormat.maxFrameSize=104857600"/>
  123.         </transportConnectors>
  124.  
  125.         <!-- destroy the spring context on shutdown to stop jetty -->
  126.         <shutdownHooks>
  127.             <bean xmlns="http://www.springframework.org/schema/beans" class="org.apache.activemq.hooks.SpringContextHook" />
  128.         </shutdownHooks>
  129.  
  130.     </broker>
  131.  
  132.     <!--
  133.        Enable web consoles, REST and Ajax APIs and demos
  134.        The web consoles requires by default login, you can disable this in the jetty.xml file
  135.  
  136.        Take a look at ${ACTIVEMQ_HOME}/conf/jetty.xml for more details
  137.    -->
  138.     <import resource="jetty.xml"/>
  139.  
  140. </beans>
  141. <!-- END SNIPPET: example -->
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement