Guest User

ActiveMQ machine 2 node A2

a guest
Oct 30th, 2013
125
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
XML 7.01 KB | None | 0 0
  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <beans xmlns="http://www.springframework.org/schema/beans" xmlns:amq="http://activemq.apache.org/schema/core" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd   http://activemq.apache.org/schema/core http://activemq.apache.org/schema/core/activemq-core.xsd">
  3.  
  4.     <!-- Allows us to use system properties as variables in this configuration file -->
  5.     <bean class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer">
  6.         <property name="locations">
  7.             <value>file:${activemq.conf}/credentials.properties</value>
  8.         </property>
  9.     </bean>
  10.  
  11.     <!--
  12.        The <broker> element is used to configure the ActiveMQ broker.
  13.    -->
  14.     <broker xmlns="http://activemq.apache.org/schema/core" brokerName="amq-poc-node-a2" dataDirectory="${activemq.data}" advisorySupport="true">
  15.  
  16.         <!--
  17.            For better performances use VM cursor and small memory limit.
  18.            For more information, see:
  19.  
  20.            http://activemq.apache.org/message-cursors.html
  21.  
  22.            Also, if your producer is "hanging", it's probably due to producer flow control.
  23.            For more information, see:
  24.            http://activemq.apache.org/producer-flow-control.html
  25.        -->
  26.  
  27.         <destinationPolicy>
  28.             <policyMap>
  29.                 <policyEntries>
  30.                     <policyEntry producerFlowControl="true" topic="&gt;">
  31.                     <!-- The constantPendingMessageLimitStrategy is used to prevent
  32.                         slow topic consumers to block producers and affect other consumers
  33.                         by limiting the number of messages that are retained
  34.                         For more information, see:
  35.  
  36.                         http://activemq.apache.org/slow-consumer-handling.html
  37.  
  38.                    -->
  39.                         <pendingMessageLimitStrategy>
  40.                             <constantPendingMessageLimitStrategy limit="1000"/>
  41.                         </pendingMessageLimitStrategy>
  42.                     </policyEntry>
  43.                     <policyEntry memoryLimit="200mb" producerFlowControl="true" queue="&gt;" enableAudit="false">
  44.                   <!-- Use VM cursor for better latency
  45.                       For more information, see:
  46.  
  47.                       http://activemq.apache.org/message-cursors.html
  48.  
  49.                  <pendingQueuePolicy>
  50.                    <vmQueueCursor/>
  51.                  </pendingQueuePolicy>
  52.                  -->
  53.                         <networkBridgeFilterFactory>
  54.                             <conditionalNetworkBridgeFilterFactory replayWhenNoConsumers="true" />
  55.                         </networkBridgeFilterFactory>
  56.  
  57.                     </policyEntry>
  58.  
  59.                 </policyEntries>
  60.             </policyMap>
  61.         </destinationPolicy>
  62.  
  63.  
  64.         <!--
  65.            The managementContext is used to configure how ActiveMQ is exposed in
  66.            JMX. By default, ActiveMQ uses the MBean server that is started by
  67.            the JVM. For more information, see:
  68.  
  69.            http://activemq.apache.org/jmx.html
  70.        -->
  71.         <managementContext>
  72.             <managementContext createConnector="false"/>
  73.         </managementContext>
  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.  
  83.         <persistenceAdapter>
  84.             <jdbcPersistenceAdapter dataSource="#mysql-ds"/>
  85.         </persistenceAdapter>
  86.  
  87.     <!--   
  88.        <persistenceAdapter>
  89.            <kahaDB directory="${activemq.data}/kahadb"/>
  90.        </persistenceAdapter>
  91.     -->
  92.     <!--   
  93.     <persistenceAdapter>
  94.            <levelDB directory="${activemq.data}/leveldb"/>
  95.        </persistenceAdapter>
  96.     -->
  97.  
  98.           <!--
  99.            The systemUsage controls the maximum amount of space the broker will
  100.            use before slowing down producers. For more information, see:
  101.            http://activemq.apache.org/producer-flow-control.html
  102.            If using ActiveMQ embedded - the following limits could safely be used:
  103.  
  104.        <systemUsage>
  105.            <systemUsage>
  106.                <memoryUsage>
  107.                    <memoryUsage limit="20 mb"/>
  108.                </memoryUsage>
  109.                <storeUsage>
  110.                    <storeUsage limit="1 gb"/>
  111.                </storeUsage>
  112.                <tempUsage>
  113.                    <tempUsage limit="100 mb"/>
  114.                </tempUsage>
  115.            </systemUsage>
  116.        </systemUsage>
  117.        -->
  118.         <systemUsage>
  119.             <systemUsage>
  120.                 <memoryUsage>
  121.                     <memoryUsage limit="256 mb"/>
  122.                 </memoryUsage>
  123.                 <storeUsage>
  124.                     <storeUsage limit="100 gb"/>
  125.                 </storeUsage>
  126.                 <tempUsage>
  127.                     <tempUsage limit="50 gb"/>
  128.                 </tempUsage>
  129.             </systemUsage>
  130.         </systemUsage>
  131.  
  132.         <!--
  133.            The transport connectors expose ActiveMQ over a given protocol to
  134.            clients and other brokers. For more information, see:
  135.  
  136.            http://activemq.apache.org/configuring-transports.html
  137.        -->
  138.         <transportConnectors>
  139.             <!-- DOS protection, limit concurrent connections to 1000 and frame size to 100MB -->
  140.             <transportConnector name="openwire" uri="tcp://0.0.0.0:61616?maximumConnections=1000&amp;wireformat.maxFrameSize=104857600" auditNetworkProducers="true"/>
  141.             <!--<transportConnector name="amqp" uri="amqp://0.0.0.0:5672?maximumConnections=1000&amp;wireformat.maxFrameSize=104857600"/>-->
  142.         </transportConnectors>
  143.  
  144.         <networkConnectors>
  145.             <networkConnector name="link-to-b"
  146.                              uri="masterslave:(tcp://192.168.0.195:62626,tcp://localhost:62626)"/>
  147.         </networkConnectors>
  148.  
  149.         <!-- destroy the spring context on shutdown to stop jetty -->
  150.         <shutdownHooks>
  151.             <bean xmlns="http://www.springframework.org/schema/beans" class="org.apache.activemq.hooks.SpringContextHook"/>
  152.         </shutdownHooks>
  153.  
  154.     </broker>
  155.  <!-- MySql DataSource Sample Setup -->
  156.     <bean class="org.apache.commons.dbcp.BasicDataSource" destroy-method="close" id="mysql-ds">
  157.         <property name="driverClassName" value="com.mysql.jdbc.Driver"/>
  158.         <property name="url" value="jdbc:mysql://192.168.0.161/activemqA?relaxAutoCommit=true"/>
  159.         <property name="username" value="root"/>
  160.         <property name="password" value="test-odg"/>
  161.         <property name="poolPreparedStatements" value="true"/>
  162.     </bean>
  163.  
  164.     <!--
  165.        Enable web consoles, REST and Ajax APIs and demos
  166.  
  167.        Take a look at ${ACTIVEMQ_HOME}/conf/jetty.xml for more details
  168.    -->
  169.     <import resource="jetty.xml"/>
  170.  
  171. </beans>
Advertisement
Add Comment
Please, Sign In to add comment