Advertisement
widana

Untitled

Sep 30th, 2017
110
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
XML 5.92 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.     <bean id="logQuery" class="org.fusesource.insight.log.log4j.Log4jLogQuery"
  33.          lazy-init="false" scope="singleton"
  34.          init-method="start" destroy-method="stop">
  35.     </bean>
  36.  
  37.     <!--
  38.        The <broker> element is used to configure the ActiveMQ broker.
  39.    -->
  40.     <broker xmlns="http://activemq.apache.org/schema/core" brokerName="localhost" dataDirectory="${activemq.data}">
  41.  
  42.         <destinationPolicy>
  43.             <policyMap>
  44.               <policyEntries>
  45.                 <policyEntry topic=">" >
  46.                     <!-- The constantPendingMessageLimitStrategy is used to prevent
  47.                         slow topic consumers to block producers and affect other consumers
  48.                         by limiting the number of messages that are retained
  49.                         For more information, see:
  50.  
  51.                         http://activemq.apache.org/slow-consumer-handling.html
  52.  
  53.                    -->
  54.                   <pendingMessageLimitStrategy>
  55.                     <constantPendingMessageLimitStrategy limit="1000"/>
  56.                   </pendingMessageLimitStrategy>
  57.                 </policyEntry>
  58.               </policyEntries>
  59.             </policyMap>
  60.         </destinationPolicy>
  61.  
  62.  
  63.         <!--
  64.            The managementContext is used to configure how ActiveMQ is exposed in
  65.            JMX. By default, ActiveMQ uses the MBean server that is started by
  66.            the JVM. For more information, see:
  67.  
  68.            http://activemq.apache.org/jmx.html
  69.        -->
  70.         <managementContext>
  71.             <managementContext createConnector="false"/>
  72.         </managementContext>
  73.  
  74.         <!--
  75.            Configure message persistence for the broker. The default persistence
  76.            mechanism is the KahaDB store (identified by the kahaDB tag).
  77.            For more information, see:
  78.  
  79.            http://activemq.apache.org/persistence.html
  80.        -->
  81.         <persistenceAdapter>
  82.             <kahaDB directory="${activemq.data}/kahadb"/>
  83.         </persistenceAdapter>
  84.  
  85.  
  86.           <!--
  87.            The systemUsage controls the maximum amount of space the broker will
  88.            use before disabling caching and/or slowing down producers. For more information, see:
  89.            http://activemq.apache.org/producer-flow-control.html
  90.          -->
  91.           <systemUsage>
  92.             <systemUsage>
  93.                 <memoryUsage>
  94.                     <memoryUsage percentOfJvmHeap="70" />
  95.                 </memoryUsage>
  96.                 <storeUsage>
  97.                     <storeUsage limit="100 gb"/>
  98.                 </storeUsage>
  99.                 <tempUsage>
  100.                     <tempUsage limit="50 gb"/>
  101.                 </tempUsage>
  102.             </systemUsage>
  103.         </systemUsage>
  104.  
  105.         <!--
  106.            The transport connectors expose ActiveMQ over a given protocol to
  107.            clients and other brokers. For more information, see:
  108.  
  109.            http://activemq.apache.org/configuring-transports.html
  110.        -->
  111.         <transportConnectors>
  112.             <!-- DOS protection, limit concurrent connections to 1000 and frame size to 100MB -->
  113.             <transportConnector name="openwire" uri="tcp://0.0.0.0:61616?maximumConnections=1000&amp;wireFormat.maxFrameSize=104857600"/>
  114.             <transportConnector name="amqp" uri="amqp://0.0.0.0:5673?maximumConnections=1000&amp;wireFormat.maxFrameSize=104857600"/>
  115.             <transportConnector name="stomp+nio" uri="stomp+nio://0.0.0.0:61613?maximumConnections=1000&amp;wireFormat.maxFrameSize=104857600"/>
  116.             <transportConnector name="mqtt" uri="mqtt://0.0.0.0:1883?maximumConnections=1000&amp;wireFormat.maxFrameSize=104857600"/>
  117.             <transportConnector name="ws" uri="ws://0.0.0.0:61614?maximumConnections=1000&amp;wireFormat.maxFrameSize=104857600"/>
  118.         </transportConnectors>
  119.  
  120.         <!-- destroy the spring context on shutdown to stop jetty -->
  121.         <shutdownHooks>
  122.             <bean xmlns="http://www.springframework.org/schema/beans" class="org.apache.activemq.hooks.SpringContextHook" />
  123.         </shutdownHooks>
  124.  
  125.     </broker>
  126.  
  127.     <!--
  128.        Enable web consoles, REST and Ajax APIs and demos
  129.        The web consoles requires by default login, you can disable this in the jetty.xml file
  130.  
  131.        Take a look at ${ACTIVEMQ_HOME}/conf/jetty.xml for more details
  132.    -->
  133.     <import resource="jetty.xml"/>
  134.  
  135. </beans>
  136. <!-- END SNIPPET: example -->
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement