Guest User

activemq.xml

a guest
Aug 27th, 2013
389
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
XML 7.42 KB | None | 0 0
  1. <!-- START SNIPPET: example -->
  2. <beans
  3.  xmlns="http://www.springframework.org/schema/beans"
  4.  xmlns:amq="http://activemq.apache.org/schema/core"
  5.  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  6.  xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
  7. http://activemq.apache.org/schema/core http://activemq.apache.org/schema/core/activemq-core.xsd">
  8.  
  9.     <!-- Allows us to use system properties as variables in this configuration file -->
  10.     <bean class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer">
  11.         <property name="locations">
  12.             <value>file:${activemq.conf}/credentials.properties</value>
  13.         </property>
  14.     </bean>
  15.  
  16.     <!--
  17.        The <broker> element is used to configure the ActiveMQ broker.
  18.    -->
  19.     <broker xmlns="http://activemq.apache.org/schema/core" brokerName="localhost" dataDirectory="${activemq.data}" advisorySupport="false" persistent="true">
  20.  
  21. <destinations>
  22.     <topic physicalName="PhysName1"/>
  23.     <topic physicalName="PhysName2"/>
  24.         <topic physicalName="pub"/>
  25. </destinations>
  26.         <!--       -->
  27.  
  28.         <destinationPolicy>
  29.             <policyMap>
  30.               <policyEntries>
  31.                 <policyEntry topic=">" producerFlowControl="true">
  32.                     <!-- The constantPendingMessageLimitStrategy is used to prevent
  33.                         slow topic consumers to block producers and affect other consumers
  34.                         by limiting the number of messages that are retained
  35.                         For more information, see:
  36.  
  37.                         http://activemq.apache.org/slow-consumer-handling.html
  38.  
  39.                    -->
  40.                   <pendingMessageLimitStrategy>
  41.                     <constantPendingMessageLimitStrategy limit="1000"/>
  42.                   </pendingMessageLimitStrategy>
  43.                 </policyEntry>
  44.                 <policyEntry queue=">" producerFlowControl="true" memoryLimit="1mb">
  45.  
  46.                 </policyEntry>
  47.  
  48.                 <policyEntry topic="PhysName1">
  49.                   <subscriptionRecoveryPolicy>
  50.                     <fixedSizedSubscriptionRecoveryPolicy maximumSize="2000000"
  51.                    useSharedBuffer="false"/>
  52.                   </subscriptionRecoveryPolicy>
  53.                 </policyEntry>
  54.  
  55.               </policyEntries>
  56.             </policyMap>
  57.         </destinationPolicy>
  58.  
  59.  
  60.         <!--
  61.            The managementContext is used to configure how ActiveMQ is exposed in
  62.            JMX. By default, ActiveMQ uses the MBean server that is started by
  63.            the JVM. For more information, see:
  64.  
  65.            http://activemq.apache.org/jmx.html
  66.        -->
  67.         <managementContext>
  68.             <managementContext createConnector="false"/>
  69.         </managementContext>
  70.  
  71.         <!--
  72.            Configure message persistence for the broker. The default persistence
  73.            mechanism is the KahaDB store (identified by the kahaDB tag).
  74.            For more information, see:
  75.  
  76.            http://activemq.apache.org/persistence.html
  77.        -->
  78.         <persistenceAdapter>
  79.             <kahaDB directory="${activemq.data}/kahadb"/>
  80.         </persistenceAdapter>
  81.  
  82.         <plugins>
  83.           <simpleAuthenticationPlugin anonymousAccessAllowed="true">
  84.             <users>
  85.                 <authenticationUser username="topicadmin" password="topicadmin"
  86.                    groups="anonymous,admins"/>
  87.                 <authenticationUser username="user1" password="user1"
  88.                    groups="anonymous,user1right"/>
  89.                 <authenticationUser username="user2" password="user2"
  90.                    groups="anonymous,user2right"/>
  91.             </users>
  92.         </simpleAuthenticationPlugin>
  93.  
  94.  
  95.       <!--  Lets configure a destination based authorization mechanism -->
  96.       <authorizationPlugin>
  97.         <map>
  98.           <authorizationMap>
  99.             <authorizationEntries>
  100.               <authorizationEntry queue=">" read="admins,anonymous" write="admins" admin="admins,anonymous" />
  101.  
  102.               <authorizationEntry topic=">" read="admins"  write="admins" admin="admins" />
  103.  
  104.               <authorizationEntry topic="pub.*.>" read="admins,anonymous"  write="admins" admin="admins,anonymous" />
  105.  
  106.               <authorizationEntry topic="PhysName1.>" read="admins,user1right"  write="admins,user1right" admin="admins,user1right" />
  107.               <authorizationEntry topic="PhysName2.>" read="admins,user2right"  write="admins,user2right" admin="admins,user2right" />
  108.             </authorizationEntries>
  109.           </authorizationMap>
  110.         </map>
  111.       </authorizationPlugin>
  112.  
  113.     </plugins>
  114.  
  115.         <sslContext>
  116.                 <sslContext keyStore="server-a.ks" keyStorePassword="pwd" trustStore="trust.ks" trustStorePassword="rsashared"/>
  117.         </sslContext>
  118.  
  119.           <!--
  120.            The systemUsage controls the maximum amount of space the broker will
  121.            use before slowing down producers. For more information, see:
  122.            http://activemq.apache.org/producer-flow-control.html
  123.            If using ActiveMQ embedded - the following limits could safely be used:
  124.  
  125.        <systemUsage>
  126.            <systemUsage>
  127.                <memoryUsage>
  128.                    <memoryUsage limit="20 mb"/>
  129.                  
  130.                </memoryUsage>
  131.                <storeUsage>
  132.                    <storeUsage limit="1 gb"/>
  133.                </storeUsage>
  134.                <tempUsage>
  135.                    <tempUsage limit="100 mb"/>
  136.                </tempUsage>
  137.            </systemUsage>
  138.        </systemUsage>
  139.        -->
  140.           <systemUsage>
  141.             <systemUsage>
  142.                 <memoryUsage>
  143.                     <memoryUsage limit="64 mb"/>
  144.                 </memoryUsage>
  145.                 <storeUsage>
  146.                     <storeUsage limit="3 gb"/>
  147.                 </storeUsage>
  148.                 <tempUsage>
  149.                     <tempUsage limit="1 gb"/>
  150.                 </tempUsage>
  151.             </systemUsage>
  152.         </systemUsage>
  153.  
  154.         <!--
  155.            The transport connectors expose ActiveMQ over a given protocol to
  156.            clients and other brokers. For more information, see:
  157.  
  158.            http://activemq.apache.org/configuring-transports.html
  159.        -->
  160.         <transportConnectors>
  161.             <!-- DOS protection, limit concurrent connections to 1000 and frame size to 100MB -->
  162.             <transportConnector name="openwire" uri="tcp://0.0.0.0:61616?maximumConnections=1000&amp;wireformat.maxFrameSize=104857600"/>
  163. <transportConnector name="stomp" uri="stomp://localhost:61613"/>
  164. <transportConnector name="mqtt" uri="mqtt+nio://0.0.0.0:1883"/>
  165. <!--   <transportConnector name="amqp" uri="amqp://0.0.0.0:5672?maximumConnections=1000&amp;wireformat.maxFrameSize=104857600"/> -->
  166.  
  167.             <transportConnector name="ssl" uri="ssl://0.0.0.0:61617?trace=true?needClientAuth=false"/>
  168.         </transportConnectors>
  169.  
  170.         <!-- destroy the spring context on shutdown to stop jetty -->
  171.         <shutdownHooks>
  172.             <bean xmlns="http://www.springframework.org/schema/beans" class="org.apache.activemq.hooks.SpringContextHook" />
  173.         </shutdownHooks>
  174.  
  175.     </broker>
  176.  
  177.     <!--
  178.        Enable web consoles, REST and Ajax APIs and demos
  179.  
  180.        Take a look at ${ACTIVEMQ_HOME}/conf/jetty.xml for more details
  181.    -->
  182.     <import resource="jetty.xml"/>
  183.  
  184. </beans>
  185. <!-- END SNIPPET: example -->
Advertisement
Add Comment
Please, Sign In to add comment