Update version according to OSCI-856
[packages/precise/mcollective.git] / ext / activemq / examples / multi-broker / broker1-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="broker1" 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 network connectors for a network of brokers. The
53           MCollective ActiveMQ connector uses TWO bi-directional
54           connectors per link, because the short-lived reply queues
55           require conduitSubscriptions be set to false.
56
57           In this config, broker1 connects to both other brokers; neither
58           of the other two have a <networkConnectors> element.
59         -->
60         <networkConnectors>
61           <!-- broker1 -> broker2 -->
62           <networkConnector
63                 name="broker1-broker2-topics"
64                 uri="static:(tcp://broker2:61616)"
65                 userName="amq"
66                 password="secret"
67                 duplex="true"
68                 decreaseNetworkConsumerPriority="true"
69                 networkTTL="2"
70                 dynamicOnly="true">
71                 <excludedDestinations>
72                         <queue physicalName=">" />
73                 </excludedDestinations>
74           </networkConnector>
75           <networkConnector
76                 name="broker1-broker2-queues"
77                 uri="static:(tcp://broker2:61616)"
78                 userName="amq"
79                 password="secret"
80                 duplex="true"
81                 decreaseNetworkConsumerPriority="true"
82                 networkTTL="2"
83                 dynamicOnly="true"
84                 conduitSubscriptions="false">
85                 <excludedDestinations>
86                         <topic physicalName=">" />
87                 </excludedDestinations>
88           </networkConnector>
89
90           <!-- broker1 -> broker3 -->
91           <networkConnector
92                 name="broker1-broker3-topics"
93                 uri="static:(tcp://broker3:61616)"
94                 userName="amq"
95                 password="secret"
96                 duplex="true"
97                 decreaseNetworkConsumerPriority="true"
98                 networkTTL="2"
99                 dynamicOnly="true">
100                 <excludedDestinations>
101                         <queue physicalName=">" />
102                 </excludedDestinations>
103           </networkConnector>
104           <networkConnector
105                 name="broker1-broker3-queues"
106                 uri="static:(tcp://broker3:61616)"
107                 userName="amq"
108                 password="secret"
109                 duplex="true"
110                 decreaseNetworkConsumerPriority="true"
111                 networkTTL="2"
112                 dynamicOnly="true"
113                 conduitSubscriptions="false">
114                 <excludedDestinations>
115                         <topic physicalName=">" />
116                 </excludedDestinations>
117           </networkConnector>
118         </networkConnectors>
119
120         <!--
121           Configure message persistence for the broker. MCollective only
122           requires this in a network of brokers, where it's used to prevent
123           duplicate messages.
124
125           The default persistence mechanism is the KahaDB store (identified by
126           the kahaDB tag). For more information, see:
127
128           http://activemq.apache.org/persistence.html
129         -->
130         <persistenceAdapter>
131             <kahaDB directory="${activemq.base}/data/kahadb"/>
132         </persistenceAdapter>
133
134         <plugins>
135           <statisticsBrokerPlugin/>
136
137           <!--
138             This configures the users and groups used by this broker. Groups
139             are referenced below, in the write/read/admin attributes
140             of each authorizationEntry element.
141           -->
142           <simpleAuthenticationPlugin>
143             <users>
144               <authenticationUser username="amq" password="secret" groups="admins,everyone"/>
145               <authenticationUser username="mcollective" password="marionette" groups="mcollective,everyone"/>
146               <authenticationUser username="admin" password="secret" groups="mcollective,admins,everyone"/>
147             </users>
148           </simpleAuthenticationPlugin>
149
150           <!--
151             Configure which users are allowed to read and write where. Permissions
152             are organized by group; groups are configured above, in the
153             authentication plugin.
154
155             With the rules below, both servers and admin users belong to group
156             mcollective, which can both issue and respond to commands. For an
157             example that splits permissions and doesn't allow servers to issue
158             commands, see:
159             http://docs.puppetlabs.com/mcollective/deploy/middleware/activemq.html#detailed-restrictions
160           -->
161           <authorizationPlugin>
162             <map>
163               <authorizationMap>
164                 <authorizationEntries>
165                   <authorizationEntry queue=">" write="admins" read="admins" admin="admins" />
166                   <authorizationEntry topic=">" write="admins" read="admins" admin="admins" />
167                   <authorizationEntry topic="mcollective.>" write="mcollective" read="mcollective" admin="mcollective" />
168                   <authorizationEntry queue="mcollective.>" write="mcollective" read="mcollective" admin="mcollective" />
169                   <!--
170                     The advisory topics are part of ActiveMQ, and all users need access to them.
171                     The "everyone" group is not special; you need to ensure every user is a member.
172                   -->
173                   <authorizationEntry topic="ActiveMQ.Advisory.>" read="everyone" write="everyone" admin="everyone"/>
174                 </authorizationEntries>
175               </authorizationMap>
176             </map>
177           </authorizationPlugin>
178         </plugins>
179
180         <!--
181           The systemUsage controls the maximum amount of space the broker will
182           use for messages. For more information, see:
183           http://docs.puppetlabs.com/mcollective/deploy/middleware/activemq.html#memory-and-temp-usage-for-messages-systemusage
184         -->
185         <systemUsage>
186             <systemUsage>
187                 <memoryUsage>
188                     <memoryUsage limit="20 mb"/>
189                 </memoryUsage>
190                 <storeUsage>
191                     <storeUsage limit="1 gb" name="foo"/>
192                 </storeUsage>
193                 <tempUsage>
194                     <tempUsage limit="100 mb"/>
195                 </tempUsage>
196             </systemUsage>
197         </systemUsage>
198
199         <!--
200           The transport connectors allow ActiveMQ to listen for connections over
201           a given protocol. MCollective uses Stomp, and other ActiveMQ brokers
202           use OpenWire. You'll need different URLs depending on whether you are
203           using TLS. For more information, see:
204
205           http://docs.puppetlabs.com/mcollective/deploy/middleware/activemq.html#transport-connectors
206         -->
207         <transportConnectors>
208             <transportConnector name="openwire" uri="tcp://0.0.0.0:61616"/>
209             <transportConnector name="stomp+nio" uri="stomp+nio://0.0.0.0:61613"/>
210             <!-- If using TLS, uncomment this and comment out the previous connector:
211               <transportConnector name="stomp+ssl" uri="stomp+ssl://0.0.0.0:61614?needClientAuth=true"/>
212             -->
213         </transportConnectors>
214     </broker>
215
216     <!--
217       Enable web consoles, REST and Ajax APIs and demos.
218       It also includes Camel (with its web console); see ${ACTIVEMQ_HOME}/conf/camel.xml for more info.
219
220       See ${ACTIVEMQ_HOME}/conf/jetty.xml for more details.
221     -->
222     <import resource="jetty.xml"/>
223 </beans>