mirror of https://github.com/apache/activemq.git
https://issues.apache.org/activemq/browse/AMQ-1894 - added scalabilty configuration and made initial commit of the patch
git-svn-id: https://svn.apache.org/repos/asf/activemq/trunk@812128 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
26d147afe2
commit
9b305d669b
|
@ -30,6 +30,15 @@
|
|||
<include>conf/*.cert</include>
|
||||
</includes>
|
||||
</fileSet>
|
||||
|
||||
<!-- Copy over all sample configurations -->
|
||||
<fileSet>
|
||||
<directory>src/sample-conf</directory>
|
||||
<outputDirectory>conf/</outputDirectory>
|
||||
<includes>
|
||||
<include>activemq-*.xml</include>
|
||||
</includes>
|
||||
</fileSet>
|
||||
|
||||
<!-- lets copy the portions of the admin web app we need - as we can't exclude stuff from the WAR -->
|
||||
<fileSet>
|
||||
|
|
|
@ -0,0 +1,54 @@
|
|||
<!--
|
||||
Licensed to the Apache Software Foundation (ASF) under one or more
|
||||
contributor license agreements. See the NOTICE file distributed with
|
||||
this work for additional information regarding copyright ownership.
|
||||
The ASF licenses this file to You under the Apache License, Version 2.0
|
||||
(the "License"); you may not use this file except in compliance with
|
||||
the License. You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
-->
|
||||
<beans
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://camel.apache.org/schema/spring http://camel.apache.org/schema/spring/camel-spring.xsd">
|
||||
<!--
|
||||
Lets deploy some Enterprise Integration Patterns inside the ActiveMQ Message Broker
|
||||
For more details see
|
||||
|
||||
http://activemq.apache.org/enterprise-integration-patterns.html
|
||||
-->
|
||||
<camelContext id="camel" xmlns="http://camel.apache.org/schema/spring">
|
||||
|
||||
<!-- You can use a <package> element for each root package to search for Java routes -->
|
||||
<package>org.foo.bar</package>
|
||||
|
||||
<!-- You can use Spring XML syntax to define the routes here using the <route> element -->
|
||||
<route>
|
||||
<from uri="activemq:example.A"/>
|
||||
<to uri="activemq:example.B"/>
|
||||
</route>
|
||||
</camelContext>
|
||||
|
||||
<!--
|
||||
Lets configure some Camel endpoints
|
||||
|
||||
http://activemq.apache.org/camel/components.html
|
||||
-->
|
||||
|
||||
<!-- configure the camel activemq component to use the current broker -->
|
||||
<bean id="activemq" class="org.apache.activemq.camel.component.ActiveMQComponent" >
|
||||
<property name="connectionFactory">
|
||||
<bean class="org.apache.activemq.ActiveMQConnectionFactory">
|
||||
<property name="brokerURL" value="vm://localhost?create=false&waitForStart=10000" />
|
||||
<property name="userName" value="${activemq.username}"/>
|
||||
<property name="password" value="${activemq.password}"/>
|
||||
</bean>
|
||||
</property>
|
||||
</bean>
|
||||
</beans>
|
|
@ -1,4 +1,4 @@
|
|||
<!--
|
||||
<!--
|
||||
Licensed to the Apache Software Foundation (ASF) under one or more
|
||||
contributor license agreements. See the NOTICE file distributed with
|
||||
this work for additional information regarding copyright ownership.
|
||||
|
@ -14,23 +14,20 @@
|
|||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
-->
|
||||
<!-- START SNIPPET: example -->
|
||||
<beans>
|
||||
<!--
|
||||
An embedded servlet engine for serving up the Admin consoles, REST and Ajax APIs and some demos
|
||||
-->
|
||||
<jetty xmlns="http://mortbay.com/schemas/jetty/1.0">
|
||||
<connectors>
|
||||
<nioConnector port="8161"/>
|
||||
</connectors>
|
||||
|
||||
<broker brokerName="broker" persistent="false" useJmx="false" xmlns="http://activemq.apache.org/schema/core">
|
||||
<transportConnectors>
|
||||
<transportConnector uri="tcp://localhost:62001"/>
|
||||
</transportConnectors>
|
||||
|
||||
<networkConnectors>
|
||||
<!-- This broker will connect to the brokers specified in networkConnector uri -->
|
||||
<networkConnector uri="static:(tcp://localhost:62002,tcp://localhost:62003)" failover="true"/>
|
||||
</networkConnectors>
|
||||
|
||||
<persistenceAdapter>
|
||||
<memoryPersistenceAdapter/>
|
||||
</persistenceAdapter>
|
||||
</broker>
|
||||
|
||||
</beans>
|
||||
<!-- END SNIPPET: example -->
|
||||
<handlers>
|
||||
<webAppContext contextPath="/admin" resourceBase="${activemq.base}/webapps/admin" logUrlOnStart="true"/>
|
||||
<webAppContext contextPath="/camel" resourceBase="${activemq.base}/webapps/camel" logUrlOnStart="true"/>
|
||||
<webAppContext contextPath="/demo" resourceBase="${activemq.base}/webapps/demo" logUrlOnStart="true"/>
|
||||
<webAppContext contextPath="/fileserver" resourceBase="${activemq.base}/webapps/fileserver" logUrlOnStart="true"/>
|
||||
</handlers>
|
||||
</jetty>
|
||||
</beans>
|
|
@ -14,80 +14,52 @@
|
|||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
-->
|
||||
<!-- START SNIPPET: example -->
|
||||
<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-2.0.xsd
|
||||
http://activemq.apache.org/schema/core http://activemq.apache.org/schema/core/activemq-core.xsd
|
||||
http://camel.apache.org/schema/spring http://camel.apache.org/schema/spring/camel-spring.xsd">
|
||||
http://activemq.apache.org/schema/core http://activemq.apache.org/schema/core/activemq-core.xsd">
|
||||
|
||||
<!-- Allows us to use system properties as variables in this configuration file -->
|
||||
<bean class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer">
|
||||
<property name="locations">
|
||||
<value>file:${activemq.base}/conf/credentials.properties</value>
|
||||
</property>
|
||||
</bean>
|
||||
<bean class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer"/>
|
||||
|
||||
<!--
|
||||
The <broker> element is used to configure the ActiveMQ broker.
|
||||
|
||||
Tips:
|
||||
- Change the brokerName attribute to something unique
|
||||
-->
|
||||
<broker xmlns="http://activemq.apache.org/schema/core" brokerName="localhost" dataDirectory="${activemq.base}/data">
|
||||
|
||||
<!-- Destination specific policies using destination names or wildcards -->
|
||||
<destinationPolicy>
|
||||
<policyMap>
|
||||
<policyEntries>
|
||||
<policyEntry queue=">" memoryLimit="5mb"/>
|
||||
<policyEntry topic=">" memoryLimit="5mb">
|
||||
<!-- you can add other policies too such as these
|
||||
<dispatchPolicy>
|
||||
<strictOrderDispatchPolicy/>
|
||||
</dispatchPolicy>
|
||||
<subscriptionRecoveryPolicy>
|
||||
<lastImageSubscriptionRecoveryPolicy/>
|
||||
</subscriptionRecoveryPolicy>
|
||||
-->
|
||||
</policyEntry>
|
||||
</policyEntries>
|
||||
</policyMap>
|
||||
</destinationPolicy>
|
||||
|
||||
<!-- Use the following to configure how ActiveMQ is exposed in JMX -->
|
||||
<!--
|
||||
The managementContext is used to configure how ActiveMQ is exposed in
|
||||
JMX. By default, ActiveMQ uses the MBean server that is started by
|
||||
the JVM. For more information, see:
|
||||
|
||||
http://activemq.apache.org/jmx.html
|
||||
-->
|
||||
<managementContext>
|
||||
<managementContext createConnector="false"/>
|
||||
</managementContext>
|
||||
|
||||
<!-- The store and forward broker networks ActiveMQ will listen to -->
|
||||
<networkConnectors>
|
||||
<!-- by default just auto discover the other brokers -->
|
||||
<networkConnector name="default-nc" uri="multicast://default"/>
|
||||
<!-- Example of a static configuration:
|
||||
<networkConnector name="host1 and host2" uri="static://(tcp://host1:61616,tcp://host2:61616)"/>
|
||||
-->
|
||||
</networkConnectors>
|
||||
|
||||
<persistenceAdapter>
|
||||
<amqPersistenceAdapter syncOnWrite="false" directory="${activemq.base}/data" maxFileLength="20 mb"/>
|
||||
</persistenceAdapter>
|
||||
|
||||
<!-- Use the following if you wish to configure the journal with JDBC -->
|
||||
<!--
|
||||
<persistenceAdapter>
|
||||
<journaledJDBC dataDirectory="${activemq.base}/data" dataSource="#postgres-ds"/>
|
||||
</persistenceAdapter>
|
||||
<!--
|
||||
Configure message persistence for the broker. The default persistence
|
||||
mechanism is the KahaDB store (identified by the kahaDB tag).
|
||||
For more information, see:
|
||||
|
||||
http://activemq.apache.org/persistence.html
|
||||
-->
|
||||
|
||||
<!-- Or if you want to use pure JDBC without a journal -->
|
||||
<!--
|
||||
<persistenceAdapter>
|
||||
<jdbcPersistenceAdapter dataSource="#postgres-ds"/>
|
||||
<kahaDB directory="${activemq.base}/data/kahadb" indexWriteBatchSize="1000" enableIndexWriteAsync="true" enableJournalDiskSyncs="false" />
|
||||
</persistenceAdapter>
|
||||
-->
|
||||
|
||||
<sslContext>
|
||||
<sslContext keyStore="file:${activemq.base}/conf/broker.ks" keyStorePassword="password" trustStore="file:${activemq.base}/conf/broker.ts" trustStorePassword="password"/>
|
||||
</sslContext>
|
||||
|
||||
<!-- The maximum about of space the broker will use before slowing down producers -->
|
||||
<!--
|
||||
The systemUsage controls the maximum amount of space the broker will
|
||||
use before slowing down producers. For more information, see:
|
||||
|
||||
http://activemq.apache.org/producer-flow-control.html
|
||||
-->
|
||||
<systemUsage>
|
||||
<systemUsage>
|
||||
<memoryUsage>
|
||||
|
@ -103,120 +75,28 @@
|
|||
</systemUsage>
|
||||
|
||||
|
||||
<!-- The transport connectors ActiveMQ will listen to -->
|
||||
<!--
|
||||
The transport connectors expose ActiveMQ over a given protocol to
|
||||
clients and other brokers. For more information, see:
|
||||
|
||||
http://activemq.apache.org/configuring-transports.html
|
||||
-->
|
||||
<transportConnectors>
|
||||
<transportConnector name="openwire" uri="tcp://0.0.0.0:61616" discoveryUri="multicast://default"/>
|
||||
<transportConnector name="ssl" uri="ssl://0.0.0.0:61617"/>
|
||||
<transportConnector name="stomp" uri="stomp://0.0.0.0:61613"/>
|
||||
<transportConnector name="xmpp" uri="xmpp://0.0.0.0:61222"/>
|
||||
<transportConnector name="openwire" uri="tcp://0.0.0.0:61616"/>
|
||||
</transportConnectors>
|
||||
|
||||
</broker>
|
||||
|
||||
<!--
|
||||
** Lets deploy some Enterprise Integration Patterns inside the ActiveMQ Message Broker
|
||||
** For more details see
|
||||
**
|
||||
** http://activemq.apache.org/enterprise-integration-patterns.html
|
||||
-->
|
||||
<camelContext id="camel" xmlns="http://camel.apache.org/schema/spring">
|
||||
|
||||
<!-- You can use a <package> element for each root package to search for Java routes -->
|
||||
<package>org.foo.bar</package>
|
||||
|
||||
<!-- You can use Spring XML syntax to define the routes here using the <route> element -->
|
||||
<route>
|
||||
<from uri="activemq:example.A"/>
|
||||
<to uri="activemq:example.B"/>
|
||||
</route>
|
||||
</camelContext>
|
||||
|
||||
<!--
|
||||
** Lets configure some Camel endpoints
|
||||
**
|
||||
** http://activemq.apache.org/camel/components.html
|
||||
<!--
|
||||
Uncomment to enable Camel
|
||||
Take a look at activemq-camel.xml for more details
|
||||
|
||||
<import resource="activemq-camel.xml"/>
|
||||
-->
|
||||
|
||||
<!-- configure the camel activemq component to use the current broker -->
|
||||
<bean id="activemq" class="org.apache.activemq.camel.component.ActiveMQComponent" >
|
||||
<property name="connectionFactory">
|
||||
<bean class="org.apache.activemq.ActiveMQConnectionFactory">
|
||||
<property name="brokerURL" value="vm://localhost?create=false&waitForStart=10000" />
|
||||
<property name="userName" value="${activemq.username}"/>
|
||||
<property name="password" value="${activemq.password}"/>
|
||||
</bean>
|
||||
</property>
|
||||
</bean>
|
||||
|
||||
|
||||
|
||||
<!-- Uncomment to create a command agent to respond to message based admin commands on the ActiveMQ.Agent topic -->
|
||||
<!--
|
||||
<commandAgent xmlns="http://activemq.apache.org/schema/core" brokerUrl="vm://localhost" username="${activemq.username}" password="${activemq.password}"/>
|
||||
<!--
|
||||
Enable web consoles, REST and Ajax APIs and demos
|
||||
Take a look at activemq-jetty.xml for more details
|
||||
<import resource="activemq-jetty.xml"/>
|
||||
-->
|
||||
|
||||
|
||||
<!-- An embedded servlet engine for serving up the Admin console -->
|
||||
<jetty xmlns="http://mortbay.com/schemas/jetty/1.0">
|
||||
<connectors>
|
||||
<nioConnector port="8161"/>
|
||||
</connectors>
|
||||
|
||||
<handlers>
|
||||
<webAppContext contextPath="/admin" resourceBase="${activemq.base}/webapps/admin" logUrlOnStart="true"/>
|
||||
<webAppContext contextPath="/camel" resourceBase="${activemq.base}/webapps/camel" logUrlOnStart="true"/>
|
||||
<webAppContext contextPath="/demo" resourceBase="${activemq.base}/webapps/demo" logUrlOnStart="true"/>
|
||||
<webAppContext contextPath="/fileserver" resourceBase="${activemq.base}/webapps/fileserver" logUrlOnStart="true"/>
|
||||
</handlers>
|
||||
</jetty>
|
||||
|
||||
<!-- This xbean configuration file supports all the standard spring xml configuration options -->
|
||||
|
||||
<!-- Postgres DataSource Sample Setup -->
|
||||
<!--
|
||||
<bean id="postgres-ds" class="org.postgresql.ds.PGPoolingDataSource">
|
||||
<property name="serverName" value="localhost"/>
|
||||
<property name="databaseName" value="activemq"/>
|
||||
<property name="portNumber" value="0"/>
|
||||
<property name="user" value="activemq"/>
|
||||
<property name="password" value="activemq"/>
|
||||
<property name="dataSourceName" value="postgres"/>
|
||||
<property name="initialConnections" value="1"/>
|
||||
<property name="maxConnections" value="10"/>
|
||||
</bean>
|
||||
-->
|
||||
|
||||
<!-- MySql DataSource Sample Setup -->
|
||||
<!--
|
||||
<bean id="mysql-ds" class="org.apache.commons.dbcp.BasicDataSource" destroy-method="close">
|
||||
<property name="driverClassName" value="com.mysql.jdbc.Driver"/>
|
||||
<property name="url" value="jdbc:mysql://localhost/activemq?relaxAutoCommit=true"/>
|
||||
<property name="username" value="activemq"/>
|
||||
<property name="password" value="activemq"/>
|
||||
<property name="maxActive" value="200"/>
|
||||
<property name="poolPreparedStatements" value="true"/>
|
||||
</bean>
|
||||
-->
|
||||
|
||||
<!-- Oracle DataSource Sample Setup -->
|
||||
<!--
|
||||
<bean id="oracle-ds" class="org.apache.commons.dbcp.BasicDataSource" destroy-method="close">
|
||||
<property name="driverClassName" value="oracle.jdbc.driver.OracleDriver"/>
|
||||
<property name="url" value="jdbc:oracle:thin:@localhost:1521:AMQDB"/>
|
||||
<property name="username" value="scott"/>
|
||||
<property name="password" value="tiger"/>
|
||||
<property name="maxActive" value="200"/>
|
||||
<property name="poolPreparedStatements" value="true"/>
|
||||
</bean>
|
||||
-->
|
||||
|
||||
<!-- Embedded Derby DataSource Sample Setup -->
|
||||
<!--
|
||||
<bean id="derby-ds" class="org.apache.derby.jdbc.EmbeddedDataSource">
|
||||
<property name="databaseName" value="derbydb"/>
|
||||
<property name="createDatabase" value="create"/>
|
||||
</bean>
|
||||
-->
|
||||
|
||||
</beans>
|
||||
<!-- END SNIPPET: example -->
|
||||
|
|
|
@ -14,22 +14,17 @@
|
|||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
-->
|
||||
<!-- START SNIPPET: example -->
|
||||
<beans>
|
||||
|
||||
<broker name="b1" persistent="false" useJmx="false" xmlns="http://activemq.apache.org/schema/core">
|
||||
<transportConnectors>
|
||||
<transportConnector uri="tcp://localhost:61001" discoveryUri="multicast://default"/>
|
||||
</transportConnectors>
|
||||
|
||||
<networkConnectors>
|
||||
<networkConnector uri="multicast://default"/>
|
||||
</networkConnectors>
|
||||
|
||||
<persistenceAdapter>
|
||||
<memoryPersistenceAdapter/>
|
||||
</persistenceAdapter>
|
||||
</broker>
|
||||
|
||||
</beans>
|
||||
<!-- END SNIPPET: example -->
|
||||
<broker xmlns="http://activemq.apache.org/schema/core" brokerName="command-broker" dataDirectory="${activemq.base}/data">
|
||||
<managementContext>
|
||||
<managementContext createConnector="true"/>
|
||||
</managementContext>
|
||||
|
||||
<transportConnectors>
|
||||
<!-- Create a XMPP transport for XMPP clients. -->
|
||||
<transportConnector name="xmpp" uri="xmpp://localhost:61222"/>
|
||||
</transportConnectors>
|
||||
</broker>
|
||||
<!-- Create a command agent -->
|
||||
<commandAgent xmlns="http://activemq.apache.org/schema/core" brokerUrl="vm://localhost"/>
|
||||
</beans>
|
|
@ -0,0 +1,318 @@
|
|||
<!--
|
||||
Licensed to the Apache Software Foundation (ASF) under one or more
|
||||
contributor license agreements. See the NOTICE file distributed with
|
||||
this work for additional information regarding copyright ownership.
|
||||
The ASF licenses this file to You under the Apache License, Version 2.0
|
||||
(the "License"); you may not use this file except in compliance with
|
||||
the License. You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
-->
|
||||
<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-2.0.xsd
|
||||
http://activemq.apache.org/schema/core http://activemq.apache.org/schema/core/activemq-core.xsd
|
||||
http://activemq.apache.org/camel/schema/spring http://activemq.apache.org/camel/schema/spring/camel-spring.xsd">
|
||||
|
||||
<!--
|
||||
Allows us to use system properties as variables in this configuration
|
||||
file. For more information, see the Javadoc:
|
||||
|
||||
http://static.springframework.org/spring/docs/2.5.x/api/org/springframework/beans/factory/config/PropertyPlaceholderConfigurer.html
|
||||
-->
|
||||
<bean class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer">
|
||||
<property name="locations">
|
||||
<value>file:${activemq.base}/conf/credentials.properties</value>
|
||||
</property>
|
||||
</bean>
|
||||
|
||||
<!--
|
||||
The <broker> element is used to configure the ActiveMQ broker.
|
||||
|
||||
Tips:
|
||||
- Change the brokerName attribute to something unique
|
||||
-->
|
||||
|
||||
<broker xmlns="http://activemq.apache.org/schema/core" brokerName="amq-broker" useJmx="true">
|
||||
|
||||
<!--
|
||||
Examples of destination-specific policies using destination
|
||||
names or wildcards. For more information, see:
|
||||
|
||||
http://activemq.apache.org/per-destination-policies.html
|
||||
http://activemq.apache.org/destination-features.html
|
||||
http://activemq.apache.org/slow-consumer-handling.html
|
||||
http://activemq.apache.org/subscription-recovery-policy.html
|
||||
-->
|
||||
<destinationPolicy>
|
||||
<policyMap>
|
||||
<policyEntries>
|
||||
<!--
|
||||
Limit ALL queues and topics to using 5mb of memory and turn on producer flow control
|
||||
-->
|
||||
<policyEntry queue=">" producerFlowControl="true" memoryLimit="5mb"/>
|
||||
<policyEntry topic=">" producerFlowControl="true" memoryLimit="5mb">
|
||||
<dispatchPolicy>
|
||||
<!--
|
||||
Use total ordering, see:
|
||||
http://activemq.apache.org/total-ordering.html
|
||||
-->
|
||||
<strictOrderDispatchPolicy/>
|
||||
</dispatchPolicy>
|
||||
<subscriptionRecoveryPolicy>
|
||||
<!--
|
||||
Upon subscription, receive the last image sent
|
||||
on the destination.
|
||||
-->
|
||||
<lastImageSubscriptionRecoveryPolicy/>
|
||||
</subscriptionRecoveryPolicy>
|
||||
</policyEntry>
|
||||
</policyEntries>
|
||||
</policyMap>
|
||||
</destinationPolicy>
|
||||
|
||||
<!--
|
||||
The managementContext is used to configure how ActiveMQ is exposed in
|
||||
JMX. By default, ActiveMQ uses the MBean server that is started by
|
||||
the JVM. For more information, see:
|
||||
|
||||
http://activemq.apache.org/jmx.html
|
||||
-->
|
||||
<managementContext>
|
||||
<managementContext createConnector="false"/>
|
||||
</managementContext>
|
||||
|
||||
<!--
|
||||
The network connectors are used to create a network of brokers. For
|
||||
more information, see:
|
||||
|
||||
http://activemq.apache.org/networks-of-brokers.html
|
||||
-->
|
||||
<!-- networkConnectors-->
|
||||
<!--
|
||||
This connector automatically discovers the other brokers using
|
||||
IP multicast. Such discovery is possible only because the
|
||||
openwire transport connector is advertised via the default IP
|
||||
multicast group. For more information on multicast, see:
|
||||
|
||||
http://activemq.apache.org/multicast-transport-reference.html
|
||||
|
||||
<networkConnector name="default-nc" uri="multicast://default"/>
|
||||
-->
|
||||
|
||||
<!--
|
||||
Example of a static configuration. For more information, see:
|
||||
|
||||
http://activemq.apache.org/static-transport-reference.html
|
||||
|
||||
<networkConnector name="host1 and host2" uri="static://(tcp://host1:61616,tcp://host2:61616)"/>
|
||||
-->
|
||||
<!-- /networkConnectors-->
|
||||
|
||||
<!--
|
||||
Configure message persistence for the broker. The default persistence
|
||||
mechanism is the AMQ store (identified by the amqPersistenceAdapter).
|
||||
For more information, see:
|
||||
|
||||
http://activemq.apache.org/persistence.html
|
||||
-->
|
||||
<persistenceAdapter>
|
||||
<kahaDB directory="${activemq.base}/data/dynamic-broker1/kahadb" indexWriteBatchSize="1000" enableIndexWriteAsync="true" enableJournalDiskSyncs="false" />
|
||||
</persistenceAdapter>
|
||||
|
||||
<!--
|
||||
Configure the following if you wish to use journaled JDBC for message
|
||||
persistence.
|
||||
|
||||
<persistenceAdapter>
|
||||
<journaledJDBC dataDirectory="${activemq.base}/data" dataSource="#postgres-ds"/>
|
||||
</persistenceAdapter>
|
||||
-->
|
||||
|
||||
<!--
|
||||
Configure the following if you wish to use non-journaled JDBC for message
|
||||
persistence.
|
||||
|
||||
<persistenceAdapter>
|
||||
<jdbcPersistenceAdapter dataSource="#postgres-ds"/>
|
||||
</persistenceAdapter>
|
||||
-->
|
||||
|
||||
<!--
|
||||
The sslContext can be used to configure broker-specific SSL properties.
|
||||
For more information, see:
|
||||
|
||||
http://activemq.apache.org/how-do-i-use-ssl.html
|
||||
-->
|
||||
<sslContext>
|
||||
<sslContext keyStore="file:${activemq.base}/conf/broker.ks"
|
||||
keyStorePassword="password" trustStore="file:${activemq.base}/conf/broker.ts"
|
||||
trustStorePassword="password"/>
|
||||
</sslContext>
|
||||
|
||||
|
||||
<!--
|
||||
The systemUsage controls the maximum amount of space the broker will
|
||||
use before slowing down producers. For more information, see:
|
||||
|
||||
http://activemq.apache.org/producer-flow-control.html
|
||||
-->
|
||||
<systemUsage>
|
||||
<systemUsage>
|
||||
<memoryUsage>
|
||||
<memoryUsage limit="20 mb" />
|
||||
</memoryUsage>
|
||||
<storeUsage>
|
||||
<storeUsage limit="1 gb" />
|
||||
</storeUsage>
|
||||
<tempUsage>
|
||||
<tempUsage limit="100 mb" />
|
||||
</tempUsage>
|
||||
</systemUsage>
|
||||
</systemUsage>
|
||||
|
||||
|
||||
<!--
|
||||
The transport connectors expose ActiveMQ over a given protocol to
|
||||
clients and other brokers. For more information, see:
|
||||
|
||||
http://activemq.apache.org/configuring-transports.html
|
||||
-->
|
||||
<transportConnectors>
|
||||
<!-- Create a TCP transport that is advertised on via an IP multicast
|
||||
group named default. -->
|
||||
<transportConnector name="openwire" uri="tcp://localhost:61616" discoveryUri="multicast://default"/>
|
||||
<!-- Create a SSL transport. Make sure to configure the SSL options
|
||||
via the system properties or the sslContext element. -->
|
||||
<transportConnector name="ssl" uri="ssl://localhost:61617"/>
|
||||
<!-- Create a STOMP transport for STOMP clients. -->
|
||||
<transportConnector name="stomp" uri="stomp://localhost:61613"/>
|
||||
<!-- Create a XMPP transport for XMPP clients. -->
|
||||
<transportConnector name="xmpp" uri="xmpp://localhost:61222"/>
|
||||
</transportConnectors>
|
||||
|
||||
</broker>
|
||||
|
||||
<!--
|
||||
Lets deploy some Enterprise Integration Patterns inside the ActiveMQ Message Broker
|
||||
For more details see
|
||||
|
||||
http://activemq.apache.org/enterprise-integration-patterns.html
|
||||
-->
|
||||
<camelContext id="camel" xmlns="http://camel.apache.org/schema/spring">
|
||||
|
||||
<!-- You can use a <package> element for each root package to search for Java routes -->
|
||||
<package>org.foo.bar</package>
|
||||
|
||||
<!-- You can use Spring XML syntax to define the routes here using the <route> element -->
|
||||
<route>
|
||||
<from uri="activemq:example.A"/>
|
||||
<to uri="activemq:example.B"/>
|
||||
</route>
|
||||
</camelContext>
|
||||
|
||||
<!--
|
||||
Lets configure some Camel endpoints
|
||||
|
||||
http://activemq.apache.org/camel/components.html
|
||||
-->
|
||||
|
||||
<!-- configure the camel activemq component to use the current broker -->
|
||||
<bean id="activemq" class="org.apache.activemq.camel.component.ActiveMQComponent" >
|
||||
<property name="connectionFactory">
|
||||
<bean class="org.apache.activemq.ActiveMQConnectionFactory">
|
||||
<property name="brokerURL" value="vm://localhost?create=false&waitForStart=10000" />
|
||||
<property name="userName" value="${activemq.username}"/>
|
||||
<property name="password" value="${activemq.password}"/>
|
||||
</bean>
|
||||
</property>
|
||||
</bean>
|
||||
|
||||
<!--
|
||||
Uncomment to create a command agent to respond to message based admin
|
||||
commands on the ActiveMQ.Agent topic. For more information, see:
|
||||
|
||||
http://activemq.apache.org/command-agent.html
|
||||
|
||||
<commandAgent xmlns="http://activemq.apache.org/schema/core" brokerUrl="vm://localhost"/>
|
||||
-->
|
||||
|
||||
|
||||
<!--
|
||||
An embedded servlet engine for serving up the Admin console and other demos.
|
||||
For more information, see:
|
||||
|
||||
http://activemq.apache.org/web-console.html
|
||||
-->
|
||||
<jetty xmlns="http://mortbay.com/schemas/jetty/1.0">
|
||||
<connectors>
|
||||
<nioConnector port="8161"/>
|
||||
</connectors>
|
||||
|
||||
<handlers>
|
||||
<webAppContext contextPath="/admin" resourceBase="${activemq.base}/webapps/admin" logUrlOnStart="true"/>
|
||||
<webAppContext contextPath="/demo" resourceBase="${activemq.base}/webapps/demo" logUrlOnStart="true"/>
|
||||
<webAppContext contextPath="/fileserver" resourceBase="${activemq.base}/webapps/fileserver" logUrlOnStart="true"/>
|
||||
</handlers>
|
||||
</jetty>
|
||||
|
||||
<!--
|
||||
This xbean configuration file supports all the standard Spring XML
|
||||
configuration options such as the following bean definitions.
|
||||
-->
|
||||
|
||||
<!-- Postgres DataSource Sample Setup -->
|
||||
<!--
|
||||
<bean id="postgres-ds" class="org.postgresql.ds.PGPoolingDataSource">
|
||||
<property name="serverName" value="localhost"/>
|
||||
<property name="databaseName" value="activemq"/>
|
||||
<property name="portNumber" value="0"/>
|
||||
<property name="user" value="activemq"/>
|
||||
<property name="password" value="activemq"/>
|
||||
<property name="dataSourceName" value="postgres"/>
|
||||
<property name="initialConnections" value="1"/>
|
||||
<property name="maxConnections" value="10"/>
|
||||
</bean>
|
||||
-->
|
||||
|
||||
<!-- MySql DataSource Sample Setup -->
|
||||
<!--
|
||||
<bean id="mysql-ds" class="org.apache.commons.dbcp.BasicDataSource" destroy-method="close">
|
||||
<property name="driverClassName" value="com.mysql.jdbc.Driver"/>
|
||||
<property name="url" value="jdbc:mysql://localhost/activemq?relaxAutoCommit=true"/>
|
||||
<property name="username" value="activemq"/>
|
||||
<property name="password" value="activemq"/>
|
||||
<property name="maxActive" value="200"/>
|
||||
<property name="poolPreparedStatements" value="true"/>
|
||||
</bean>
|
||||
-->
|
||||
|
||||
<!-- Oracle DataSource Sample Setup -->
|
||||
<!--
|
||||
<bean id="oracle-ds" class="org.apache.commons.dbcp.BasicDataSource" destroy-method="close">
|
||||
<property name="driverClassName" value="oracle.jdbc.driver.OracleDriver"/>
|
||||
<property name="url" value="jdbc:oracle:thin:@localhost:1521:AMQDB"/>
|
||||
<property name="username" value="scott"/>
|
||||
<property name="password" value="tiger"/>
|
||||
<property name="maxActive" value="200"/>
|
||||
<property name="poolPreparedStatements" value="true"/>
|
||||
</bean>
|
||||
-->
|
||||
|
||||
<!-- Embedded Derby DataSource Sample Setup -->
|
||||
<!--
|
||||
<bean id="derby-ds" class="org.apache.derby.jdbc.EmbeddedDataSource">
|
||||
<property name="databaseName" value="derbydb"/>
|
||||
<property name="createDatabase" value="create"/>
|
||||
</bean>
|
||||
-->
|
||||
|
||||
</beans>
|
|
@ -0,0 +1,83 @@
|
|||
<!--
|
||||
Licensed to the Apache Software Foundation (ASF) under one or more
|
||||
contributor license agreements. See the NOTICE file distributed with
|
||||
this work for additional information regarding copyright ownership.
|
||||
The ASF licenses this file to You under the Apache License, Version 2.0
|
||||
(the "License"); you may not use this file except in compliance with
|
||||
the License. You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
-->
|
||||
<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-2.0.xsd
|
||||
http://activemq.apache.org/schema/core http://activemq.apache.org/schema/core/activemq-core.xsd">
|
||||
|
||||
<bean class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer"/>
|
||||
|
||||
<broker xmlns="http://activemq.apache.org/schema/core" brokerName="dynamic-broker1" dataDirectory="${activemq.base}/data">
|
||||
|
||||
<!-- Destination specific policies using destination names or wildcards -->
|
||||
<destinationPolicy>
|
||||
<policyMap>
|
||||
<policyEntries>
|
||||
<policyEntry queue=">" producerFlowControl="true" memoryLimit="20mb">
|
||||
<deadLetterStrategy>
|
||||
<individualDeadLetterStrategy queuePrefix="DLQ." useQueueForQueueMessages="true" />
|
||||
</deadLetterStrategy>
|
||||
</policyEntry>
|
||||
<policyEntry topic=">" producerFlowControl="true" memoryLimit="20mb">
|
||||
</policyEntry>
|
||||
</policyEntries>
|
||||
</policyMap>
|
||||
</destinationPolicy>
|
||||
|
||||
<!-- Use the following to configure how ActiveMQ is exposed in JMX -->
|
||||
<managementContext>
|
||||
<managementContext createConnector="true"/>
|
||||
</managementContext>
|
||||
|
||||
<networkConnectors>
|
||||
<networkConnector uri="multicast://default"
|
||||
dynamicOnly="true"
|
||||
networkTTL="3"
|
||||
prefetchSize="1"
|
||||
decreaseNetworkConsumerPriority="true" />
|
||||
</networkConnectors>
|
||||
|
||||
<persistenceAdapter>
|
||||
<kahaDB directory="${activemq.base}/data/dynamic-broker1/kahadb" indexWriteBatchSize="1000" enableIndexWriteAsync="true" enableJournalDiskSyncs="false" />
|
||||
</persistenceAdapter>
|
||||
|
||||
<!-- The maximum about of space the broker will use before slowing down producers -->
|
||||
<systemUsage>
|
||||
<systemUsage>
|
||||
<memoryUsage>
|
||||
<memoryUsage limit="20 mb"/>
|
||||
</memoryUsage>
|
||||
<storeUsage>
|
||||
<storeUsage limit="1 gb" name="foo"/>
|
||||
</storeUsage>
|
||||
<tempUsage>
|
||||
<tempUsage limit="100 mb"/>
|
||||
</tempUsage>
|
||||
</systemUsage>
|
||||
</systemUsage>
|
||||
|
||||
|
||||
<!-- The transport connectors ActiveMQ will listen to -->
|
||||
<transportConnectors>
|
||||
<transportConnector name="openwire" uri="tcp://0.0.0.0:61616" discoveryUri="multicast://default" />
|
||||
</transportConnectors>
|
||||
|
||||
</broker>
|
||||
|
||||
</beans>
|
|
@ -0,0 +1,84 @@
|
|||
<!--
|
||||
Licensed to the Apache Software Foundation (ASF) under one or more
|
||||
contributor license agreements. See the NOTICE file distributed with
|
||||
this work for additional information regarding copyright ownership.
|
||||
The ASF licenses this file to You under the Apache License, Version 2.0
|
||||
(the "License"); you may not use this file except in compliance with
|
||||
the License. You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
-->
|
||||
<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-2.0.xsd
|
||||
http://activemq.apache.org/schema/core http://activemq.apache.org/schema/core/activemq-core.xsd
|
||||
http://activemq.apache.org/camel/schema/spring http://activemq.apache.org/camel/schema/spring/camel-spring.xsd">
|
||||
|
||||
<bean class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer"/>
|
||||
|
||||
<broker xmlns="http://activemq.apache.org/schema/core" brokerName="dynamic-broker2" dataDirectory="${activemq.base}/data">
|
||||
|
||||
<!-- Destination specific policies using destination names or wildcards -->
|
||||
<destinationPolicy>
|
||||
<policyMap>
|
||||
<policyEntries>
|
||||
<policyEntry queue=">" producerFlowControl="true" memoryLimit="20mb">
|
||||
<deadLetterStrategy>
|
||||
<individualDeadLetterStrategy queuePrefix="DLQ." useQueueForQueueMessages="true" />
|
||||
</deadLetterStrategy>
|
||||
</policyEntry>
|
||||
<policyEntry topic=">" producerFlowControl="true" memoryLimit="20mb">
|
||||
</policyEntry>
|
||||
</policyEntries>
|
||||
</policyMap>
|
||||
</destinationPolicy>
|
||||
|
||||
<!-- Use the following to configure how ActiveMQ is exposed in JMX -->
|
||||
<managementContext>
|
||||
<managementContext createConnector="true" connectorPort="1100"/>
|
||||
</managementContext>
|
||||
|
||||
<networkConnectors>
|
||||
<networkConnector uri="multicast://default"
|
||||
dynamicOnly="true"
|
||||
networkTTL="3"
|
||||
prefetchSize="1"
|
||||
decreaseNetworkConsumerPriority="true" />
|
||||
</networkConnectors>
|
||||
|
||||
<persistenceAdapter>
|
||||
<kahaDB directory="${activemq.base}/data/dynamic-broker2/kahadb" indexWriteBatchSize="1000" enableIndexWriteAsync="true" enableJournalDiskSyncs="false" />
|
||||
</persistenceAdapter>
|
||||
|
||||
<!-- The maximum about of space the broker will use before slowing down producers -->
|
||||
<systemUsage>
|
||||
<systemUsage>
|
||||
<memoryUsage>
|
||||
<memoryUsage limit="20 mb"/>
|
||||
</memoryUsage>
|
||||
<storeUsage>
|
||||
<storeUsage limit="1 gb" name="foo"/>
|
||||
</storeUsage>
|
||||
<tempUsage>
|
||||
<tempUsage limit="100 mb"/>
|
||||
</tempUsage>
|
||||
</systemUsage>
|
||||
</systemUsage>
|
||||
|
||||
|
||||
<!-- The transport connectors ActiveMQ will listen to -->
|
||||
<transportConnectors>
|
||||
<transportConnector name="openwire" uri="tcp://0.0.0.0:61618" discoveryUri="multicast://default" />
|
||||
</transportConnectors>
|
||||
|
||||
</broker>
|
||||
|
||||
</beans>
|
|
@ -14,7 +14,6 @@
|
|||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
-->
|
||||
<!-- START SNIPPET: xbean -->
|
||||
<beans>
|
||||
|
||||
<broker useJmx="false" brokerName="jdbcBroker" xmlns="http://activemq.apache.org/schema/core">
|
||||
|
@ -23,13 +22,18 @@
|
|||
</persistenceAdapter>
|
||||
|
||||
<transportConnectors>
|
||||
<transportConnector name="default" uri="tcp://localhost:61616"/>
|
||||
<transportConnector name="default" uri="tcp://0.0.0.0:61616"/>
|
||||
</transportConnectors>
|
||||
</broker>
|
||||
<!-- This xbean configuration file supports all the standard spring xml configuration options -->
|
||||
|
||||
|
||||
<!-- Embedded Derby DataSource Sample Setup -->
|
||||
<bean id="derby-ds" class="org.apache.derby.jdbc.EmbeddedDataSource">
|
||||
<property name="databaseName" value="derbydb"/>
|
||||
<property name="createDatabase" value="create"/>
|
||||
</bean>
|
||||
|
||||
<!-- Postgres DataSource Sample Setup -->
|
||||
<!--
|
||||
<!--
|
||||
<bean id="postgres-ds" class="org.postgresql.ds.PGPoolingDataSource">
|
||||
<property name="serverName" value="localhost"/>
|
||||
<property name="databaseName" value="activemq"/>
|
||||
|
@ -41,7 +45,7 @@
|
|||
<property name="maxConnections" value="10"/>
|
||||
</bean>
|
||||
-->
|
||||
|
||||
|
||||
<!-- MySql DataSource Sample Setup -->
|
||||
<!--
|
||||
<bean id="mysql-ds" class="org.apache.commons.dbcp.BasicDataSource" destroy-method="close">
|
||||
|
@ -49,15 +53,21 @@
|
|||
<property name="url" value="jdbc:mysql://localhost/activemq?relaxAutoCommit=true"/>
|
||||
<property name="username" value="activemq"/>
|
||||
<property name="password" value="activemq"/>
|
||||
<property name="maxActive" value="200"/>
|
||||
<property name="poolPreparedStatements" value="true"/>
|
||||
</bean>
|
||||
-->
|
||||
|
||||
<!-- Embedded Derby DataSource Sample Setup -->
|
||||
<bean id="derby-ds" class="org.apache.derby.jdbc.EmbeddedDataSource">
|
||||
<property name="databaseName" value="derbydb"/>
|
||||
<property name="createDatabase" value="create"/>
|
||||
</bean>
|
||||
|
||||
</beans>
|
||||
<!-- END SNIPPET: xbean -->
|
||||
<!-- Oracle DataSource Sample Setup -->
|
||||
<!--
|
||||
<bean id="oracle-ds" class="org.apache.commons.dbcp.BasicDataSource" destroy-method="close">
|
||||
<property name="driverClassName" value="oracle.jdbc.driver.OracleDriver"/>
|
||||
<property name="url" value="jdbc:oracle:thin:@localhost:1521:AMQDB"/>
|
||||
<property name="username" value="scott"/>
|
||||
<property name="password" value="tiger"/>
|
||||
<property name="maxActive" value="200"/>
|
||||
<property name="poolPreparedStatements" value="true"/>
|
||||
</bean>
|
||||
-->
|
||||
|
||||
</beans>
|
|
@ -0,0 +1,77 @@
|
|||
<!--
|
||||
Licensed to the Apache Software Foundation (ASF) under one or more
|
||||
contributor license agreements. See the NOTICE file distributed with
|
||||
this work for additional information regarding copyright ownership.
|
||||
The ASF licenses this file to You under the Apache License, Version 2.0
|
||||
(the "License"); you may not use this file except in compliance with
|
||||
the License. You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
-->
|
||||
<!--
|
||||
Tune ActiveMQ broker so it can handle large number of queues (tens of thousands)
|
||||
For more information, see:
|
||||
http://activemq.apache.org/how-do-i-configure-10s-of-1000s-of-queues-in-a-single-broker-.html
|
||||
|
||||
Be sure to make necessary changes in your startup script, to
|
||||
|
||||
1. Give broker enough memory
|
||||
2. Disable dedicated task runner
|
||||
|
||||
e.g. ACTIVEMQ_OPTS="-Xmx1024M -Dorg.apache.activemq.UseDedicatedTaskRunner=false"
|
||||
|
||||
To run ActiveMQ with this configuration add xbean:conf/activemq-scalability.xml to your command
|
||||
e.g. $ bin/activemq xbean:conf/activemq-scalability.xml
|
||||
-->
|
||||
<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-2.0.xsd
|
||||
http://activemq.apache.org/schema/core http://activemq.apache.org/schema/core/activemq-core.xsd">
|
||||
|
||||
<!-- Allows us to use system properties as variables in this configuration file -->
|
||||
<bean class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer"/>
|
||||
|
||||
<broker xmlns="http://activemq.apache.org/schema/core" brokerName="localhost" dataDirectory="${activemq.base}/data" useJmx="false" advisorySupport="false">
|
||||
|
||||
<!--
|
||||
Turn on optimizedDispatch
|
||||
For more information, see:
|
||||
http://activemq.apache.org/per-destination-policies.html
|
||||
-->
|
||||
<destinationPolicy>
|
||||
<policyMap>
|
||||
<policyEntries>
|
||||
<policyEntry queue=">" optimizedDispatch="true" />
|
||||
</policyEntries>
|
||||
</policyMap>
|
||||
</destinationPolicy>
|
||||
|
||||
<!--
|
||||
Use KahaDB for persistence
|
||||
For more information, see:
|
||||
http://activemq.apache.org/kahadb.html
|
||||
-->
|
||||
<persistenceAdapter>
|
||||
<kahaDB directory="${activemq.base}/data/kahadb" indexWriteBatchSize="1000" enableIndexWriteAsync="true" enableJournalDiskSyncs="false" />
|
||||
</persistenceAdapter>
|
||||
|
||||
<!--
|
||||
Use NIO transport
|
||||
For more information, see:
|
||||
http://activemq.apache.org/configuring-transports.html#ConfiguringTransports-TheNIOTransport
|
||||
-->
|
||||
<transportConnectors>
|
||||
<transportConnector name="nio" uri="nio://0.0.0.0:61616"/>
|
||||
</transportConnectors>
|
||||
|
||||
</broker>
|
||||
|
||||
</beans>
|
|
@ -0,0 +1,77 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!--
|
||||
Licensed to the Apache Software Foundation (ASF) under one or more
|
||||
contributor license agreements. See the NOTICE file distributed with
|
||||
this work for additional information regarding copyright ownership.
|
||||
The ASF licenses this file to You under the Apache License, Version 2.0
|
||||
(the "License"); you may not use this file except in compliance with
|
||||
the License. You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
-->
|
||||
<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-2.0.xsd
|
||||
http://activemq.apache.org/schema/core http://activemq.apache.org/schema/core/activemq-core.xsd">
|
||||
|
||||
<bean class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer">
|
||||
<property name="locations">
|
||||
<value>file:${activemq.base}/conf/credentials.properties</value>
|
||||
</property>
|
||||
</bean>
|
||||
|
||||
<broker useJmx="true" persistent="false" xmlns="http://activemq.apache.org/schema/core">
|
||||
|
||||
<plugins>
|
||||
<simpleAuthenticationPlugin>
|
||||
<users>
|
||||
<authenticationUser username="system" password="manager"
|
||||
groups="users,admins"/>
|
||||
<authenticationUser username="user" password="password"
|
||||
groups="users"/>
|
||||
<authenticationUser username="guest" password="password" groups="guests"/>
|
||||
</users>
|
||||
</simpleAuthenticationPlugin>
|
||||
|
||||
|
||||
<!-- lets configure a destination based authorization mechanism -->
|
||||
<authorizationPlugin>
|
||||
<map>
|
||||
<authorizationMap>
|
||||
<authorizationEntries>
|
||||
<authorizationEntry queue=">" read="admins" write="admins" admin="admins" />
|
||||
<authorizationEntry queue="USERS.>" read="users" write="users" admin="users" />
|
||||
<authorizationEntry queue="GUEST.>" read="guests" write="guests,users" admin="guests,users" />
|
||||
|
||||
<authorizationEntry queue="TEST.Q" read="guests" write="guests" />
|
||||
|
||||
<authorizationEntry topic=">" read="admins" write="admins" admin="admins" />
|
||||
<authorizationEntry topic="USERS.>" read="users" write="users" admin="users" />
|
||||
<authorizationEntry topic="GUEST.>" read="guests" write="guests,users" admin="guests,users" />
|
||||
|
||||
<authorizationEntry topic="ActiveMQ.Advisory.>" read="guests,users" write="guests,users" admin="guests,users"/>
|
||||
</authorizationEntries>
|
||||
</authorizationMap>
|
||||
</map>
|
||||
</authorizationPlugin>
|
||||
</plugins>
|
||||
|
||||
<transportConnectors>
|
||||
<transportConnector name="default" uri="tcp://0.0.0.0:61616"/>
|
||||
</transportConnectors>
|
||||
|
||||
</broker>
|
||||
|
||||
<commandAgent xmlns="http://activemq.apache.org/schema/core" brokerUrl="vm://localhost" username="${activemq.username}" password="${activemq.password}"/>
|
||||
|
||||
<import resource="activemq-jetty.xml"/>
|
||||
|
||||
</beans>
|
|
@ -0,0 +1,81 @@
|
|||
<!--
|
||||
Licensed to the Apache Software Foundation (ASF) under one or more
|
||||
contributor license agreements. See the NOTICE file distributed with
|
||||
this work for additional information regarding copyright ownership.
|
||||
The ASF licenses this file to You under the Apache License, Version 2.0
|
||||
(the "License"); you may not use this file except in compliance with
|
||||
the License. You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
-->
|
||||
<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-2.0.xsd
|
||||
http://activemq.apache.org/schema/core http://activemq.apache.org/schema/core/activemq-core.xsd
|
||||
http://activemq.apache.org/camel/schema/spring http://activemq.apache.org/camel/schema/spring/camel-spring.xsd">
|
||||
|
||||
<!-- Allows us to use system properties as variables in this configuration file -->
|
||||
<bean class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer"/>
|
||||
|
||||
<broker xmlns="http://activemq.apache.org/schema/core" brokerName="static-broker1" dataDirectory="${activemq.base}/data">
|
||||
|
||||
<!-- Destination specific policies using destination names or wildcards -->
|
||||
<destinationPolicy>
|
||||
<policyMap>
|
||||
<policyEntries>
|
||||
<policyEntry queue=">" producerFlowControl="true" memoryLimit="20mb">
|
||||
<deadLetterStrategy>
|
||||
<individualDeadLetterStrategy queuePrefix="DLQ." useQueueForQueueMessages="true" />
|
||||
</deadLetterStrategy>
|
||||
</policyEntry>
|
||||
<policyEntry topic=">" producerFlowControl="true" memoryLimit="20mb">
|
||||
</policyEntry>
|
||||
</policyEntries>
|
||||
</policyMap>
|
||||
</destinationPolicy>
|
||||
|
||||
<!-- Use the following to configure how ActiveMQ is exposed in JMX -->
|
||||
<managementContext>
|
||||
<managementContext createConnector="true"/>
|
||||
</managementContext>
|
||||
|
||||
<!-- The store and forward broker networks ActiveMQ will listen to -->
|
||||
<networkConnectors>
|
||||
</networkConnectors>
|
||||
|
||||
<persistenceAdapter>
|
||||
<kahaDB directory="${activemq.base}/data/static-broker1/kahadb" indexWriteBatchSize="1000" enableIndexWriteAsync="true" enableJournalDiskSyncs="false" />
|
||||
</persistenceAdapter>
|
||||
|
||||
<!-- The maximum about of space the broker will use before slowing down producers -->
|
||||
<systemUsage>
|
||||
<systemUsage>
|
||||
<memoryUsage>
|
||||
<memoryUsage limit="20 mb"/>
|
||||
</memoryUsage>
|
||||
<storeUsage>
|
||||
<storeUsage limit="1 gb" name="foo"/>
|
||||
</storeUsage>
|
||||
<tempUsage>
|
||||
<tempUsage limit="100 mb"/>
|
||||
</tempUsage>
|
||||
</systemUsage>
|
||||
</systemUsage>
|
||||
|
||||
|
||||
<!-- The transport connectors ActiveMQ will listen to -->
|
||||
<transportConnectors>
|
||||
<transportConnector name="openwire" uri="tcp://0.0.0.0:61616"/>
|
||||
</transportConnectors>
|
||||
|
||||
</broker>
|
||||
|
||||
</beans>
|
|
@ -0,0 +1,82 @@
|
|||
<!--
|
||||
Licensed to the Apache Software Foundation (ASF) under one or more
|
||||
contributor license agreements. See the NOTICE file distributed with
|
||||
this work for additional information regarding copyright ownership.
|
||||
The ASF licenses this file to You under the Apache License, Version 2.0
|
||||
(the "License"); you may not use this file except in compliance with
|
||||
the License. You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
-->
|
||||
<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-2.0.xsd
|
||||
http://activemq.apache.org/schema/core http://activemq.apache.org/schema/core/activemq-core.xsd
|
||||
http://activemq.apache.org/camel/schema/spring http://activemq.apache.org/camel/schema/spring/camel-spring.xsd">
|
||||
|
||||
<!-- Allows us to use system properties as variables in this configuration file -->
|
||||
<bean class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer"/>
|
||||
|
||||
<broker xmlns="http://activemq.apache.org/schema/core" brokerName="static-broker1" dataDirectory="${activemq.base}/data">
|
||||
|
||||
<!-- Destination specific policies using destination names or wildcards -->
|
||||
<destinationPolicy>
|
||||
<policyMap>
|
||||
<policyEntries>
|
||||
<policyEntry queue=">" producerFlowControl="true" memoryLimit="20mb">
|
||||
<deadLetterStrategy>
|
||||
<individualDeadLetterStrategy queuePrefix="DLQ." useQueueForQueueMessages="true" />
|
||||
</deadLetterStrategy>
|
||||
</policyEntry>
|
||||
<policyEntry topic=">" producerFlowControl="true" memoryLimit="20mb">
|
||||
</policyEntry>
|
||||
</policyEntries>
|
||||
</policyMap>
|
||||
</destinationPolicy>
|
||||
|
||||
<!-- Use the following to configure how ActiveMQ is exposed in JMX -->
|
||||
<managementContext>
|
||||
<managementContext createConnector="true" connectorPort="1100"/>
|
||||
</managementContext>
|
||||
|
||||
<!-- The store and forward broker networks ActiveMQ will listen to -->
|
||||
<networkConnectors>
|
||||
<networkConnector uri="static:(tcp://localhost:61616)" duplex="true" prefetchSize="1"/>
|
||||
</networkConnectors>
|
||||
|
||||
<persistenceAdapter>
|
||||
<kahaDB directory="${activemq.base}/data/static-broker2/kahadb" indexWriteBatchSize="1000" enableIndexWriteAsync="true" enableJournalDiskSyncs="false" />
|
||||
</persistenceAdapter>
|
||||
|
||||
<!-- The maximum about of space the broker will use before slowing down producers -->
|
||||
<systemUsage>
|
||||
<systemUsage>
|
||||
<memoryUsage>
|
||||
<memoryUsage limit="20 mb"/>
|
||||
</memoryUsage>
|
||||
<storeUsage>
|
||||
<storeUsage limit="1 gb" name="foo"/>
|
||||
</storeUsage>
|
||||
<tempUsage>
|
||||
<tempUsage limit="100 mb"/>
|
||||
</tempUsage>
|
||||
</systemUsage>
|
||||
</systemUsage>
|
||||
|
||||
|
||||
<!-- The transport connectors ActiveMQ will listen to -->
|
||||
<transportConnectors>
|
||||
<transportConnector name="openwire" uri="tcp://0.0.0.0:61618"/>
|
||||
</transportConnectors>
|
||||
|
||||
</broker>
|
||||
|
||||
</beans>
|
Loading…
Reference in New Issue