b9366fc10910899023c696dafc30d13db49967a1
[packages/precise/mcollective.git] / ext / activemq / examples / multi-broker / broker3-activemq.xml
1 <beans
2   xmlns="http://www.springframework.org/schema/beans"
3   xmlns:amq="http://activemq.apache.org/schema/core"
4   xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
5   xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.0.xsd
6   http://activemq.apache.org/schema/core http://activemq.apache.org/schema/core/activemq-core.xsd
7   http://activemq.apache.org/camel/schema/spring http://activemq.apache.org/camel/schema/spring/camel-spring.xsd">
8
9     <bean class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer">
10         <property name="locations">
11             <value>file:${activemq.base}/conf/credentials.properties</value>
12         </property>
13     </bean>
14
15     <!--
16       For more information about what MCollective requires in this file,
17       see http://docs.puppetlabs.com/mcollective/deploy/middleware/activemq.html
18     -->
19
20     <!--
21       WARNING: The elements that are direct children of <broker> MUST BE IN
22       ALPHABETICAL ORDER. This is fixed in ActiveMQ 5.6.0, but affects
23       previous versions back to 5.4.
24       https://issues.apache.org/jira/browse/AMQ-3570
25     -->
26
27     <!-- In a network of brokers, the brokerName attribute must be unique. -->
28     <broker xmlns="http://activemq.apache.org/schema/core" brokerName="broker3" useJmx="true" schedulePeriodForDestinationPurge="60000">
29         <!--
30           MCollective generally expects producer flow control to be turned off.
31           It will also generate a limitless number of single-use reply queues,
32           which should be garbage-collected after about five minutes to conserve
33           memory.
34
35           For more information, see:
36           http://activemq.apache.org/producer-flow-control.html
37         -->
38         <destinationPolicy>
39           <policyMap>
40             <policyEntries>
41               <policyEntry topic=">" producerFlowControl="false"/>
42               <policyEntry queue="*.reply.>" gcInactiveDestinations="true" inactiveTimoutBeforeGC="300000" />
43             </policyEntries>
44           </policyMap>
45         </destinationPolicy>
46
47         <managementContext>
48             <managementContext createConnector="false"/>
49         </managementContext>
50
51         <!--
52           Configure message persistence for the broker. MCollective only
53           requires this in a network of brokers, where it's used to prevent
54           duplicate messages.
55
56           The default persistence mechanism is the KahaDB store (identified by
57           the kahaDB tag). For more information, see:
58
59           http://activemq.apache.org/persistence.html
60         -->
61         <persistenceAdapter>
62             <kahaDB directory="${activemq.base}/data/kahadb"/>
63         </persistenceAdapter>
64
65         <plugins>
66           <statisticsBrokerPlugin/>
67
68           <!--
69             This configures the users and groups used by this broker. Groups
70             are referenced below, in the write/read/admin attributes
71             of each authorizationEntry element.
72           -->
73           <simpleAuthenticationPlugin>
74             <users>
75               <authenticationUser username="amq" password="secret" groups="admins,everyone"/>
76               <authenticationUser username="mcollective" password="marionette" groups="mcollective,everyone"/>
77               <authenticationUser username="admin" password="secret" groups="mcollective,admins,everyone"/>
78             </users>
79           </simpleAuthenticationPlugin>
80
81           <!--
82             Configure which users are allowed to read and write where. Permissions
83             are organized by group; groups are configured above, in the
84             authentication plugin.
85
86             With the rules below, both servers and admin users belong to group
87             mcollective, which can both issue and respond to commands. For an
88             example that splits permissions and doesn't allow servers to issue
89             commands, see:
90             http://docs.puppetlabs.com/mcollective/deploy/middleware/activemq.html#detailed-restrictions
91           -->
92           <authorizationPlugin>
93             <map>
94               <authorizationMap>
95                 <authorizationEntries>
96                   <authorizationEntry queue=">" write="admins" read="admins" admin="admins" />
97                   <authorizationEntry topic=">" write="admins" read="admins" admin="admins" />
98                   <authorizationEntry topic="mcollective.>" write="mcollective" read="mcollective" admin="mcollective" />
99                   <authorizationEntry queue="mcollective.>" write="mcollective" read="mcollective" admin="mcollective" />
100                   <!--
101                     The advisory topics are part of ActiveMQ, and all users need access to them.
102                     The "everyone" group is not special; you need to ensure every user is a member.
103                   -->
104                   <authorizationEntry topic="ActiveMQ.Advisory.>" read="everyone" write="everyone" admin="everyone"/>
105                 </authorizationEntries>
106               </authorizationMap>
107             </map>
108           </authorizationPlugin>
109         </plugins>
110
111         <!--
112           The systemUsage controls the maximum amount of space the broker will
113           use for messages. For more information, see:
114           http://docs.puppetlabs.com/mcollective/deploy/middleware/activemq.html#memory-and-temp-usage-for-messages-systemusage
115         -->
116         <systemUsage>
117             <systemUsage>
118                 <memoryUsage>
119                     <memoryUsage limit="20 mb"/>
120                 </memoryUsage>
121                 <storeUsage>
122                     <storeUsage limit="1 gb" name="foo"/>
123                 </storeUsage>
124                 <tempUsage>
125                     <tempUsage limit="100 mb"/>
126                 </tempUsage>
127             </systemUsage>
128         </systemUsage>
129
130         <!--
131           The transport connectors allow ActiveMQ to listen for connections over
132           a given protocol. MCollective uses Stomp, and other ActiveMQ brokers
133           use OpenWire. You'll need different URLs depending on whether you are
134           using TLS. For more information, see:
135
136           http://docs.puppetlabs.com/mcollective/deploy/middleware/activemq.html#transport-connectors
137         -->
138         <transportConnectors>
139             <transportConnector name="openwire" uri="tcp://0.0.0.0:61616"/>
140             <transportConnector name="stomp" uri="stomp://0.0.0.0:61613"/>
141         </transportConnectors>
142     </broker>
143
144     <!--
145       Enable web consoles, REST and Ajax APIs and demos.
146       It also includes Camel (with its web console); see ${ACTIVEMQ_HOME}/conf/camel.xml for more info.
147
148       See ${ACTIVEMQ_HOME}/conf/jetty.xml for more details.
149     -->
150     <import resource="jetty.xml"/>
151 </beans>