| 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 |
|
|---|
| 18 |
<!-- Bedework: |
|---|
| 19 |
For the quickstart this file is copied out of the current configuration/build |
|---|
| 20 |
directory into the activemq configuration directory. |
|---|
| 21 |
|
|---|
| 22 |
DO NOT edit the copy of this file inside activemq. If you want to change the |
|---|
| 23 |
configuration edit a copy inside your bedework configuration directory. |
|---|
| 24 |
--> |
|---|
| 25 |
|
|---|
| 26 |
<!-- START SNIPPET: example --> |
|---|
| 27 |
<beans |
|---|
| 28 |
xmlns="http://www.springframework.org/schema/beans" |
|---|
| 29 |
xmlns:amq="http://activemq.apache.org/schema/core" |
|---|
| 30 |
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" |
|---|
| 31 |
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.0.xsd |
|---|
| 32 |
http://activemq.apache.org/schema/core http://activemq.apache.org/schema/core/activemq-core.xsd |
|---|
| 33 |
http://activemq.apache.org/camel/schema/spring http://activemq.apache.org/camel/schema/spring/camel-spring.xsd"> |
|---|
| 34 |
|
|---|
| 35 |
<!-- Allows us to use system properties as variables in this configuration file |
|---|
| 36 |
--> |
|---|
| 37 |
<bean |
|---|
| 38 |
class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer"> |
|---|
| 39 |
<!-- |
|---|
| 40 |
<property name="locations"> |
|---|
| 41 |
<value>file:///${activemq.base}/conf/credentials.properties |
|---|
| 42 |
</value> |
|---|
| 43 |
</property> |
|---|
| 44 |
--> |
|---|
| 45 |
</bean> |
|---|
| 46 |
|
|---|
| 47 |
<broker xmlns="http://activemq.apache.org/schema/core" |
|---|
| 48 |
brokerName="bedework" useJmx="true" useShutdownHook="false" > |
|---|
| 49 |
<!-- |
|---|
| 50 |
MikeD Queues for various bedework services. These are all fed by |
|---|
| 51 |
the virtual queue bedework.sysevents |
|---|
| 52 |
--> |
|---|
| 53 |
<destinations> |
|---|
| 54 |
<!-- The listener just logs the system events --> |
|---|
| 55 |
<queue name="logger" |
|---|
| 56 |
physicalName="bedework.sysevents.logger" /> |
|---|
| 57 |
|
|---|
| 58 |
<!-- The listener monitors system activity --> |
|---|
| 59 |
<queue name="monitor" |
|---|
| 60 |
physicalName="bedework.sysevents.monitor" /> |
|---|
| 61 |
|
|---|
| 62 |
<!-- The listener is the crawler which (re)indexes the system --> |
|---|
| 63 |
<queue name="crawler" |
|---|
| 64 |
physicalName="bedework.crawler" /> |
|---|
| 65 |
|
|---|
| 66 |
<!-- |
|---|
| 67 |
The listener is the scheduler which handles events appearing in |
|---|
| 68 |
the in/outbox |
|---|
| 69 |
--> |
|---|
| 70 |
<queue name="schedulerIn" |
|---|
| 71 |
physicalName="bedework.scheduleIn" /> |
|---|
| 72 |
<queue name="schedulerOut" |
|---|
| 73 |
physicalName="bedework.scheduleOut" /> |
|---|
| 74 |
|
|---|
| 75 |
<!-- <topic physicalName="SOME.TOPIC" /> --> |
|---|
| 76 |
</destinations> |
|---|
| 77 |
|
|---|
| 78 |
<!-- MikeD --> |
|---|
| 79 |
<destinationInterceptors> |
|---|
| 80 |
<virtualDestinationInterceptor> |
|---|
| 81 |
<virtualDestinations> |
|---|
| 82 |
<compositeQueue name="bedework.sysevents"> |
|---|
| 83 |
<forwardTo> |
|---|
| 84 |
<queue physicalName="bedework.sysevents.logger" /> |
|---|
| 85 |
<queue physicalName="bedework.sysevents.monitor" /> |
|---|
| 86 |
<queue physicalName="bedework.crawler" /> |
|---|
| 87 |
<filteredDestination selector="inbox = 'true'" |
|---|
| 88 |
queue="bedework.scheduleIn"/> |
|---|
| 89 |
<filteredDestination selector="outbox = 'true'" |
|---|
| 90 |
queue="bedework.scheduleOut"/> |
|---|
| 91 |
</forwardTo> |
|---|
| 92 |
</compositeQueue> |
|---|
| 93 |
</virtualDestinations> |
|---|
| 94 |
</virtualDestinationInterceptor> |
|---|
| 95 |
</destinationInterceptors> |
|---|
| 96 |
|
|---|
| 97 |
<!-- |
|---|
| 98 |
Destination specific policies using destination names or wildcards |
|---|
| 99 |
--> |
|---|
| 100 |
<destinationPolicy> |
|---|
| 101 |
<policyMap> |
|---|
| 102 |
<policyEntries> |
|---|
| 103 |
<policyEntry queue=">" memoryLimit="5mb" /> |
|---|
| 104 |
<policyEntry topic=">" memoryLimit="5mb"> |
|---|
| 105 |
<!-- |
|---|
| 106 |
you can add other policies too such as these |
|---|
| 107 |
<dispatchPolicy> <strictOrderDispatchPolicy/> |
|---|
| 108 |
</dispatchPolicy> <subscriptionRecoveryPolicy> |
|---|
| 109 |
<lastImageSubscriptionRecoveryPolicy/> |
|---|
| 110 |
</subscriptionRecoveryPolicy> |
|---|
| 111 |
--> |
|---|
| 112 |
</policyEntry> |
|---|
| 113 |
</policyEntries> |
|---|
| 114 |
</policyMap> |
|---|
| 115 |
</destinationPolicy> |
|---|
| 116 |
|
|---|
| 117 |
<!-- |
|---|
| 118 |
MikeD - there are some reports of messages not getting delivered, |
|---|
| 119 |
possibly because consumers aren't going fast enough for activemq and |
|---|
| 120 |
it tries to slow down the producers. The following disables that |
|---|
| 121 |
behavior |
|---|
| 122 |
|
|---|
| 123 |
<destinationPolicy> |
|---|
| 124 |
<policyMap> |
|---|
| 125 |
<policyEntries> |
|---|
| 126 |
<policyEntry queue=">" producerFlowControl="false" |
|---|
| 127 |
memoryLimit="64mb" /> |
|---|
| 128 |
</policyEntries> |
|---|
| 129 |
</policyMap> |
|---|
| 130 |
</destinationPolicy> |
|---|
| 131 |
--> |
|---|
| 132 |
|
|---|
| 133 |
<!-- This allows the activemq domain to appear in the jboss jmx-console --> |
|---|
| 134 |
<managementContext> |
|---|
| 135 |
<managementContext> |
|---|
| 136 |
<MBeanServer> |
|---|
| 137 |
<bean class="org.jboss.mx.util.MBeanServerLocator" |
|---|
| 138 |
factory-method="locateJBoss" xmlns=""/> |
|---|
| 139 |
</MBeanServer> |
|---|
| 140 |
</managementContext> |
|---|
| 141 |
</managementContext> |
|---|
| 142 |
|
|---|
| 143 |
<!-- The store and forward broker networks ActiveMQ will listen to --> |
|---|
| 144 |
<networkConnectors> |
|---|
| 145 |
<!-- by default just auto discover the other brokers |
|---|
| 146 |
Configured out for the time being - causes a lot of error messages |
|---|
| 147 |
<networkConnector name="default-nc" uri="multicast://default" /> |
|---|
| 148 |
--> |
|---|
| 149 |
<!-- |
|---|
| 150 |
Example of a static configuration: <networkConnector name="host1 |
|---|
| 151 |
and host2" uri="static://(tcp://host1:61616,tcp://host2:61616)"/> |
|---|
| 152 |
--> |
|---|
| 153 |
</networkConnectors> |
|---|
| 154 |
|
|---|
| 155 |
<!-- High throughput but scalability problems - perhaps OK with <=500 connections |
|---|
| 156 |
<persistenceAdapter> |
|---|
| 157 |
<amqPersistenceAdapter syncOnWrite="false" |
|---|
| 158 |
directory="${jboss.server.data.dir}/activemq-data" maxFileLength="20 mb" /> |
|---|
| 159 |
</persistenceAdapter> --> |
|---|
| 160 |
|
|---|
| 161 |
<!-- Newer adapter - handles 1000s of connections --> |
|---|
| 162 |
<persistenceAdapter> |
|---|
| 163 |
<kahaPersistenceAdapter directory="${jboss.server.data.dir}/activemq" maxDataFileLength="33554432"/> |
|---|
| 164 |
</persistenceAdapter> |
|---|
| 165 |
|
|---|
| 166 |
<!-- older and slower is jdbcPersistenceAdapter --> |
|---|
| 167 |
|
|---|
| 168 |
<!-- |
|---|
| 169 |
<sslContext> |
|---|
| 170 |
<sslContext keyStore="file:${activemq.base}/conf/broker.ks" |
|---|
| 171 |
keyStorePassword="password" |
|---|
| 172 |
trustStore="file:${activemq.base}/conf/broker.ts" |
|---|
| 173 |
trustStorePassword="password" /> |
|---|
| 174 |
</sslContext> |
|---|
| 175 |
--> |
|---|
| 176 |
|
|---|
| 177 |
<!-- |
|---|
| 178 |
The maximum amount of space the broker will use before slowing down |
|---|
| 179 |
producers |
|---|
| 180 |
--> |
|---|
| 181 |
<systemUsage> |
|---|
| 182 |
<systemUsage> |
|---|
| 183 |
<memoryUsage> |
|---|
| 184 |
<memoryUsage limit="20 mb" /> |
|---|
| 185 |
</memoryUsage> |
|---|
| 186 |
<storeUsage> |
|---|
| 187 |
<storeUsage limit="1 gb" name="foo" /> |
|---|
| 188 |
</storeUsage> |
|---|
| 189 |
<tempUsage> |
|---|
| 190 |
<tempUsage limit="100 mb" /> |
|---|
| 191 |
</tempUsage> |
|---|
| 192 |
</systemUsage> |
|---|
| 193 |
</systemUsage> |
|---|
| 194 |
|
|---|
| 195 |
|
|---|
| 196 |
<!-- The transport connectors ActiveMQ will listen to --> |
|---|
| 197 |
<transportConnectors> |
|---|
| 198 |
<transportConnector name="bedework" |
|---|
| 199 |
uri="${org.bedework.activemq.uri}" /> |
|---|
| 200 |
<!-- |
|---|
| 201 |
<transportConnector name="bedework" uri="tcp://localhost:61616" /> |
|---|
| 202 |
According to the book we shouldn't specify a discoveryUri - can lead to |
|---|
| 203 |
multiple activemq brokers eating each others messages, At the very least |
|---|
| 204 |
it leads to exceptions when I close the lid of my laptop. |
|---|
| 205 |
<transportConnector name="bedework" uri="tcp://localhost:61616" discoveryUri="multicast://default"/> |
|---|
| 206 |
<transportConnector name="xmpp" uri="xmpp://localhost:61222"/> |
|---|
| 207 |
--> |
|---|
| 208 |
</transportConnectors> |
|---|
| 209 |
|
|---|
| 210 |
</broker> |
|---|
| 211 |
|
|---|
| 212 |
<!-- |
|---|
| 213 |
** Lets dseploy some Enterprise Integration Patterns inside the ActiveMQ Message Broker |
|---|
| 214 |
** For more details see |
|---|
| 215 |
** |
|---|
| 216 |
** http://activemq.apache.org/enterprise-integration-patterns.html |
|---|
| 217 |
|
|---|
| 218 |
<camelContext id="camel" xmlns="http://activemq.apache.org/camel/schema/spring"> |
|---|
| 219 |
|
|---|
| 220 |
< ! - - You can use a <package> element for each root package to search for |
|---|
| 221 |
Java routes - - > |
|---|
| 222 |
<package>org.foo.bar</package> |
|---|
| 223 |
|
|---|
| 224 |
< ! - - You can use Spring XML syntax to define the routes here using the <route> element - - > |
|---|
| 225 |
<route> |
|---|
| 226 |
<from uri="activemq:example.A"/> |
|---|
| 227 |
<to uri="activemq:example.B"/> |
|---|
| 228 |
</route> |
|---|
| 229 |
</camelContext> |
|---|
| 230 |
--> |
|---|
| 231 |
|
|---|
| 232 |
<!-- |
|---|
| 233 |
** Lets configure some Camel endpoints |
|---|
| 234 |
** |
|---|
| 235 |
** http://activemq.apache.org/camel/components.html |
|---|
| 236 |
--> |
|---|
| 237 |
|
|---|
| 238 |
<!-- configure the camel activemq component to use the current broker |
|---|
| 239 |
<bean id="activemq" class="org.apache.activemq.camel.component.ActiveMQComponent" > |
|---|
| 240 |
<property name="connectionFactory"> |
|---|
| 241 |
<bean class="org.apache.activemq.ActiveMQConnectionFactory"> |
|---|
| 242 |
<property name="brokerURL" value="vm://localhost?create=false&waitForStart=10000" /> |
|---|
| 243 |
<property name="userName" value="${activemq.username}"/> |
|---|
| 244 |
<property name="password" value="${activemq.password}"/> |
|---|
| 245 |
</bean> |
|---|
| 246 |
</property> |
|---|
| 247 |
</bean> |
|---|
| 248 |
--> |
|---|
| 249 |
|
|---|
| 250 |
<!-- Uncomment to create a command agent to respond to message based admin commands on the ActiveMQ.Agent topic |
|---|
| 251 |
--> |
|---|
| 252 |
<!-- |
|---|
| 253 |
<commandAgent xmlns="http://activemq.apache.org/schema/core" |
|---|
| 254 |
brokerUrl="vm://localhost" |
|---|
| 255 |
username="${activemq.username}" |
|---|
| 256 |
password="${activemq.password}"/> |
|---|
| 257 |
--> |
|---|
| 258 |
|
|---|
| 259 |
<!-- An embedded servlet engine for serving up the Admin console |
|---|
| 260 |
<jetty xmlns="http://mortbay.com/schemas/jetty/1.0"> |
|---|
| 261 |
<connectors> |
|---|
| 262 |
<nioConnector port="8161"/> |
|---|
| 263 |
</connectors> |
|---|
| 264 |
|
|---|
| 265 |
<handlers> |
|---|
| 266 |
<webAppContext contextPath="/admin" resourceBase="${activemq.base}/webapps/admin" logUrlOnStart="true"/> |
|---|
| 267 |
<webAppContext contextPath="/demo" resourceBase="${activemq.base}/webapps/demo" logUrlOnStart="true"/> |
|---|
| 268 |
<webAppContext contextPath="/fileserver" resourceBase="${activemq.base}/webapps/fileserver" logUrlOnStart="true"/> |
|---|
| 269 |
</handlers> |
|---|
| 270 |
</jetty> |
|---|
| 271 |
--> |
|---|
| 272 |
<!-- This xbean configuration file supports all the standard spring xml configuration options |
|---|
| 273 |
--> |
|---|
| 274 |
|
|---|
| 275 |
|
|---|
| 276 |
</beans> |
|---|
| 277 |
|
|---|