| 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 |
<property name="locations"> |
|---|
| 40 |
<value>file:///${activemq.base}/conf/credentials.properties |
|---|
| 41 |
</value> |
|---|
| 42 |
</property> |
|---|
| 43 |
</bean> |
|---|
| 44 |
|
|---|
| 45 |
<broker xmlns="http://activemq.apache.org/schema/core" |
|---|
| 46 |
brokerName="localhost" dataDirectory="${activemq.base}/data"> |
|---|
| 47 |
<!-- |
|---|
| 48 |
MikeD Queues for various bedework services. These are all fed by |
|---|
| 49 |
the virtual queue bedework.sysevents |
|---|
| 50 |
--> |
|---|
| 51 |
<destinations> |
|---|
| 52 |
<!-- The listener just logs the system events --> |
|---|
| 53 |
<queue name="logger" |
|---|
| 54 |
physicalName="bedework.sysevents.logger" /> |
|---|
| 55 |
|
|---|
| 56 |
<!-- The listener is the crawler which (re)indexes the system --> |
|---|
| 57 |
<queue name="crawler" |
|---|
| 58 |
physicalName="bedework.crawler" /> |
|---|
| 59 |
|
|---|
| 60 |
<!-- |
|---|
| 61 |
The listener is the scheduler which handles events appearing in |
|---|
| 62 |
the in/outbox |
|---|
| 63 |
--> |
|---|
| 64 |
<queue name="schedulerIn" |
|---|
| 65 |
physicalName="bedework.scheduleIn" /> |
|---|
| 66 |
<queue name="schedulerOut" |
|---|
| 67 |
physicalName="bedework.scheduleOut" /> |
|---|
| 68 |
|
|---|
| 69 |
<!-- <topic physicalName="SOME.TOPIC" /> --> |
|---|
| 70 |
</destinations> |
|---|
| 71 |
|
|---|
| 72 |
<!-- MikeD --> |
|---|
| 73 |
<destinationInterceptors> |
|---|
| 74 |
<virtualDestinationInterceptor> |
|---|
| 75 |
<virtualDestinations> |
|---|
| 76 |
<compositeQueue name="bedework.sysevents"> |
|---|
| 77 |
<forwardTo> |
|---|
| 78 |
<queue physicalName="bedework.sysevents.logger" /> |
|---|
| 79 |
<queue physicalName="bedework.crawler" /> |
|---|
| 80 |
<filteredDestination selector="inbox = 'true'" |
|---|
| 81 |
queue="bedework.scheduleIn"/> |
|---|
| 82 |
<filteredDestination selector="outbox = 'true'" |
|---|
| 83 |
queue="bedework.scheduleOut"/> |
|---|
| 84 |
</forwardTo> |
|---|
| 85 |
</compositeQueue> |
|---|
| 86 |
</virtualDestinations> |
|---|
| 87 |
</virtualDestinationInterceptor> |
|---|
| 88 |
</destinationInterceptors> |
|---|
| 89 |
|
|---|
| 90 |
<!-- |
|---|
| 91 |
Destination specific policies using destination names or wildcards |
|---|
| 92 |
--> |
|---|
| 93 |
<destinationPolicy> |
|---|
| 94 |
<policyMap> |
|---|
| 95 |
<policyEntries> |
|---|
| 96 |
<policyEntry queue=">" memoryLimit="5mb" /> |
|---|
| 97 |
<policyEntry topic=">" memoryLimit="5mb"> |
|---|
| 98 |
<!-- |
|---|
| 99 |
you can add other policies too such as these |
|---|
| 100 |
<dispatchPolicy> <strictOrderDispatchPolicy/> |
|---|
| 101 |
</dispatchPolicy> <subscriptionRecoveryPolicy> |
|---|
| 102 |
<lastImageSubscriptionRecoveryPolicy/> |
|---|
| 103 |
</subscriptionRecoveryPolicy> |
|---|
| 104 |
--> |
|---|
| 105 |
</policyEntry> |
|---|
| 106 |
</policyEntries> |
|---|
| 107 |
</policyMap> |
|---|
| 108 |
</destinationPolicy> |
|---|
| 109 |
|
|---|
| 110 |
<!-- |
|---|
| 111 |
MikeD - there are some reports of messages not getting delivered, |
|---|
| 112 |
possibly because consumers aren't going fast enough for activemq and |
|---|
| 113 |
it tries to slow down the producers. The following disables that |
|---|
| 114 |
behavior |
|---|
| 115 |
|
|---|
| 116 |
<destinationPolicy> |
|---|
| 117 |
<policyMap> |
|---|
| 118 |
<policyEntries> |
|---|
| 119 |
<policyEntry queue=">" producerFlowControl="false" |
|---|
| 120 |
memoryLimit="64mb" /> |
|---|
| 121 |
</policyEntries> |
|---|
| 122 |
</policyMap> |
|---|
| 123 |
</destinationPolicy> |
|---|
| 124 |
--> |
|---|
| 125 |
|
|---|
| 126 |
<!-- Use the following to configure how ActiveMQ is exposed in JMX --> |
|---|
| 127 |
<managementContext> |
|---|
| 128 |
<managementContext createConnector="false" /> |
|---|
| 129 |
</managementContext> |
|---|
| 130 |
|
|---|
| 131 |
<!-- The store and forward broker networks ActiveMQ will listen to --> |
|---|
| 132 |
<networkConnectors> |
|---|
| 133 |
<!-- by default just auto discover the other brokers |
|---|
| 134 |
Configured out for the time being - causes a lot of error messages |
|---|
| 135 |
<networkConnector name="default-nc" uri="multicast://default" /> |
|---|
| 136 |
--> |
|---|
| 137 |
<!-- |
|---|
| 138 |
Example of a static configuration: <networkConnector name="host1 |
|---|
| 139 |
and host2" uri="static://(tcp://host1:61616,tcp://host2:61616)"/> |
|---|
| 140 |
--> |
|---|
| 141 |
</networkConnectors> |
|---|
| 142 |
|
|---|
| 143 |
<persistenceAdapter> |
|---|
| 144 |
<amqPersistenceAdapter syncOnWrite="false" |
|---|
| 145 |
directory="${activemq.base}/data" maxFileLength="20 mb" /> |
|---|
| 146 |
</persistenceAdapter> |
|---|
| 147 |
|
|---|
| 148 |
<!-- Use the following if you wish to configure the journal with JDBC --> |
|---|
| 149 |
<!-- |
|---|
| 150 |
<persistenceAdapter> |
|---|
| 151 |
<journaledJDBC dataDirectory="${activemq.base}/data" dataSource="#postgres-ds"/> |
|---|
| 152 |
</persistenceAdapter> |
|---|
| 153 |
--> |
|---|
| 154 |
|
|---|
| 155 |
<!-- Or if you want to use pure JDBC without a journal --> |
|---|
| 156 |
<!-- |
|---|
| 157 |
<persistenceAdapter> |
|---|
| 158 |
<jdbcPersistenceAdapter dataSource="#postgres-ds"/> |
|---|
| 159 |
</persistenceAdapter> |
|---|
| 160 |
--> |
|---|
| 161 |
|
|---|
| 162 |
<sslContext> |
|---|
| 163 |
<sslContext keyStore="file:${activemq.base}/conf/broker.ks" |
|---|
| 164 |
keyStorePassword="password" |
|---|
| 165 |
trustStore="file:${activemq.base}/conf/broker.ts" |
|---|
| 166 |
trustStorePassword="password" /> |
|---|
| 167 |
</sslContext> |
|---|
| 168 |
|
|---|
| 169 |
<!-- |
|---|
| 170 |
The maximum amount of space the broker will use before slowing down |
|---|
| 171 |
producers |
|---|
| 172 |
--> |
|---|
| 173 |
<systemUsage> |
|---|
| 174 |
<systemUsage> |
|---|
| 175 |
<memoryUsage> |
|---|
| 176 |
<memoryUsage limit="20 mb" /> |
|---|
| 177 |
</memoryUsage> |
|---|
| 178 |
<storeUsage> |
|---|
| 179 |
<storeUsage limit="1 gb" name="foo" /> |
|---|
| 180 |
</storeUsage> |
|---|
| 181 |
<tempUsage> |
|---|
| 182 |
<tempUsage limit="100 mb" /> |
|---|
| 183 |
</tempUsage> |
|---|
| 184 |
</systemUsage> |
|---|
| 185 |
</systemUsage> |
|---|
| 186 |
|
|---|
| 187 |
|
|---|
| 188 |
<!-- The transport connectors ActiveMQ will listen to --> |
|---|
| 189 |
<transportConnectors> |
|---|
| 190 |
<transportConnector name="openwire" uri="tcp://localhost:61616" discoveryUri="multicast://default"/> |
|---|
| 191 |
<transportConnector name="ssl" uri="ssl://localhost:61617"/> |
|---|
| 192 |
<transportConnector name="stomp" uri="stomp://localhost:61613"/> |
|---|
| 193 |
<transportConnector name="xmpp" uri="xmpp://localhost:61222"/> |
|---|
| 194 |
</transportConnectors> |
|---|
| 195 |
|
|---|
| 196 |
</broker> |
|---|
| 197 |
|
|---|
| 198 |
<!-- |
|---|
| 199 |
** Lets deploy some Enterprise Integration Patterns inside the ActiveMQ Message Broker |
|---|
| 200 |
** For more details see |
|---|
| 201 |
** |
|---|
| 202 |
** http://activemq.apache.org/enterprise-integration-patterns.html |
|---|
| 203 |
|
|---|
| 204 |
<camelContext id="camel" xmlns="http://activemq.apache.org/camel/schema/spring"> |
|---|
| 205 |
|
|---|
| 206 |
< ! - - You can use a <package> element for each root package to search for |
|---|
| 207 |
Java routes - - > |
|---|
| 208 |
<package>org.foo.bar</package> |
|---|
| 209 |
|
|---|
| 210 |
< ! - - You can use Spring XML syntax to define the routes here using the <route> element - - > |
|---|
| 211 |
<route> |
|---|
| 212 |
<from uri="activemq:example.A"/> |
|---|
| 213 |
<to uri="activemq:example.B"/> |
|---|
| 214 |
</route> |
|---|
| 215 |
</camelContext> |
|---|
| 216 |
--> |
|---|
| 217 |
|
|---|
| 218 |
<!-- |
|---|
| 219 |
** Lets configure some Camel endpoints |
|---|
| 220 |
** |
|---|
| 221 |
** http://activemq.apache.org/camel/components.html |
|---|
| 222 |
--> |
|---|
| 223 |
|
|---|
| 224 |
<!-- configure the camel activemq component to use the current broker |
|---|
| 225 |
<bean id="activemq" class="org.apache.activemq.camel.component.ActiveMQComponent" > |
|---|
| 226 |
<property name="connectionFactory"> |
|---|
| 227 |
<bean class="org.apache.activemq.ActiveMQConnectionFactory"> |
|---|
| 228 |
<property name="brokerURL" value="vm://localhost?create=false&waitForStart=10000" /> |
|---|
| 229 |
<property name="userName" value="${activemq.username}"/> |
|---|
| 230 |
<property name="password" value="${activemq.password}"/> |
|---|
| 231 |
</bean> |
|---|
| 232 |
</property> |
|---|
| 233 |
</bean> |
|---|
| 234 |
--> |
|---|
| 235 |
|
|---|
| 236 |
<!-- Uncomment to create a command agent to respond to message based admin commands on the ActiveMQ.Agent topic |
|---|
| 237 |
--> |
|---|
| 238 |
<!-- |
|---|
| 239 |
<commandAgent xmlns="http://activemq.apache.org/schema/core" |
|---|
| 240 |
brokerUrl="vm://localhost" |
|---|
| 241 |
username="${activemq.username}" |
|---|
| 242 |
password="${activemq.password}"/> |
|---|
| 243 |
--> |
|---|
| 244 |
|
|---|
| 245 |
<!-- An embedded servlet engine for serving up the Admin console --> |
|---|
| 246 |
<jetty xmlns="http://mortbay.com/schemas/jetty/1.0"> |
|---|
| 247 |
<connectors> |
|---|
| 248 |
<nioConnector port="8161"/> |
|---|
| 249 |
</connectors> |
|---|
| 250 |
|
|---|
| 251 |
<handlers> |
|---|
| 252 |
<webAppContext contextPath="/admin" resourceBase="${activemq.base}/webapps/admin" logUrlOnStart="true"/> |
|---|
| 253 |
<webAppContext contextPath="/demo" resourceBase="${activemq.base}/webapps/demo" logUrlOnStart="true"/> |
|---|
| 254 |
<webAppContext contextPath="/fileserver" resourceBase="${activemq.base}/webapps/fileserver" logUrlOnStart="true"/> |
|---|
| 255 |
</handlers> |
|---|
| 256 |
</jetty> |
|---|
| 257 |
|
|---|
| 258 |
<!-- This xbean configuration file supports all the standard spring xml configuration options |
|---|
| 259 |
--> |
|---|
| 260 |
|
|---|
| 261 |
<!-- Postgres DataSource Sample Setup --> |
|---|
| 262 |
<!-- |
|---|
| 263 |
<bean id="postgres-ds" class="org.postgresql.ds.PGPoolingDataSource"> |
|---|
| 264 |
<property name="serverName" value="localhost"/> |
|---|
| 265 |
<property name="databaseName" value="activemq"/> |
|---|
| 266 |
<property name="portNumber" value="0"/> |
|---|
| 267 |
<property name="user" value="activemq"/> |
|---|
| 268 |
<property name="password" value="activemq"/> |
|---|
| 269 |
<property name="dataSourceName" value="postgres"/> |
|---|
| 270 |
<property name="initialConnections" value="1"/> |
|---|
| 271 |
<property name="maxConnections" value="10"/> |
|---|
| 272 |
</bean> |
|---|
| 273 |
--> |
|---|
| 274 |
|
|---|
| 275 |
<!-- MySql DataSource Sample Setup --> |
|---|
| 276 |
<!-- |
|---|
| 277 |
<bean id="mysql-ds" class="org.apache.commons.dbcp.BasicDataSource" destroy-method="close"> |
|---|
| 278 |
<property name="driverClassName" value="com.mysql.jdbc.Driver"/> |
|---|
| 279 |
<property name="url" value="jdbc:mysql://localhost/activemq?relaxAutoCommit=true"/> |
|---|
| 280 |
<property name="username" value="activemq"/> |
|---|
| 281 |
<property name="password" value="activemq"/> |
|---|
| 282 |
<property name="maxActive" value="200"/> |
|---|
| 283 |
<property name="poolPreparedStatements" value="true"/> |
|---|
| 284 |
</bean> |
|---|
| 285 |
--> |
|---|
| 286 |
|
|---|
| 287 |
<!-- Oracle DataSource Sample Setup --> |
|---|
| 288 |
<!-- |
|---|
| 289 |
<bean id="oracle-ds" class="org.apache.commons.dbcp.BasicDataSource" destroy-method="close"> |
|---|
| 290 |
<property name="driverClassName" value="oracle.jdbc.driver.OracleDriver"/> |
|---|
| 291 |
<property name="url" value="jdbc:oracle:thin:@localhost:1521:AMQDB"/> |
|---|
| 292 |
<property name="username" value="scott"/> |
|---|
| 293 |
<property name="password" value="tiger"/> |
|---|
| 294 |
<property name="maxActive" value="200"/> |
|---|
| 295 |
<property name="poolPreparedStatements" value="true"/> |
|---|
| 296 |
</bean> |
|---|
| 297 |
--> |
|---|
| 298 |
|
|---|
| 299 |
<!-- Embedded Derby DataSource Sample Setup --> |
|---|
| 300 |
<!-- |
|---|
| 301 |
<bean id="derby-ds" class="org.apache.derby.jdbc.EmbeddedDataSource"> |
|---|
| 302 |
<property name="databaseName" value="derbydb"/> |
|---|
| 303 |
<property name="createDatabase" value="create"/> |
|---|
| 304 |
</bean> |
|---|
| 305 |
--> |
|---|
| 306 |
|
|---|
| 307 |
<!-- MikeD - other speed up tips: Async Sends |
|---|
| 308 |
queueConnectionFactory = new ActiveMQConnectionFactory(queue_user, queue_password, queue_url); |
|---|
| 309 |
queueConnectionPool = new PooledConnectionFactory(queueConnectionFactory); |
|---|
| 310 |
queueConnectionPool.setMaxConnections(200); |
|---|
| 311 |
|
|---|
| 312 |
// This line is used to make your connection async |
|---|
| 313 |
((ActiveMQConnectionFactory)queueConnectionFactory).setUseAsyncSend(true); |
|---|
| 314 |
--> |
|---|
| 315 |
|
|---|
| 316 |
</beans> |
|---|
| 317 |
<!-- END SNIPPET: example |
|---|
| 318 |
--> |
|---|