Skip to content

Instantly share code, notes, and snippets.

@robinbowes
Last active August 29, 2015 14:05
Show Gist options
  • Save robinbowes/959257ba8fc710d31e24 to your computer and use it in GitHub Desktop.
Save robinbowes/959257ba8fc710d31e24 to your computer and use it in GitHub Desktop.
probs with activemq
<!--
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:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.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.conf}/credentials.properties</value>
</property>
</bean>
<!--
Enable web consoles, REST and Ajax APIs and demos
See ${ACTIVEMQ_HOME}/conf/jetty.xml for more details.
-->
<import resource="jetty.xml" />
<!--
The <broker> element is used to configure the ActiveMQ broker.
-->
<broker xmlns="http://activemq.apache.org/schema/core" useJmx="true" brokerName="amq-eu-master" dataDirectory="${activemq.data}" networkConnectorStartAsync="true"
schedulePeriodForDestinationPurge="60000">
<!--
For better performances use VM cursor and small memory limit.
For more information, see:
http://activemq.apache.org/message-cursors.html
Also, if your producer is "hanging", it's probably due to producer
flow control.
For more information, see:
http://activemq.apache.org/producer-flow-control.html
-->
<destinationPolicy>
<policyMap>
<policyEntries>
<policyEntry topic=">" producerFlowControl="false" memoryLimit="1mb">
<pendingSubscriberPolicy>
<vmCursor />
</pendingSubscriberPolicy>
<!-- The constantPendingMessageLimitStrategy is used to prevent
slow topic consumers to block producers and affect other consumers
by limiting the number of messages that are retained
For more information, see:
http://activemq.apache.org/slow-consumer-handling.html
-->
<pendingMessageLimitStrategy>
<constantPendingMessageLimitStrategy limit="1000" />
</pendingMessageLimitStrategy>
</policyEntry>
<policyEntry queue=">" producerFlowControl="false" memoryLimit="1mb" gcInactiveDestinations="true" inactiveTimoutBeforeGC="300000">
<!--
Use VM cursor for better latency
For more information, see:
http://activemq.apache.org/message-cursors.html
-->
<pendingQueuePolicy>
<vmQueueCursor />
</pendingQueuePolicy>
</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" connectorHost="localhost" connectorPort="1099" rmiServerPort="1098" />
</managementContext>
<!--
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
-->
<persistenceAdapter>
<kahaDB directory="${activemq.data}/kahadb" />
</persistenceAdapter>
<plugins>
<!--
Enable the statisticsBrokerPlugin to allow ActiveMQ to collect
statistics.
-->
<statisticsBrokerPlugin />
<!--
Here we define a default set of users
-->
<simpleAuthenticationPlugin>
<users>
<authenticationUser username='broker' password='8DM6iJxGw7NDu53vVbd9kaZhHLO2OKVNc5gyMDCEBw8=' groups='brokers,everyone' />
<authenticationUser username='client' password='Q0P/gdouCeDmAUi+JTe40QaJlPJMIeq4WGCYuzHKxkQ=' groups='servers,clients,everyone' />
<authenticationUser username='server' password='pGx9LlKXNlomNKRMHDF0Fp8/bfEZ504hNLKs0NGhMwY=' groups='servers,everyone' />
</users>
</simpleAuthenticationPlugin>
<authorizationPlugin>
<map>
<authorizationMap>
<authorizationEntries>
<authorizationEntry queue=">" write="brokers" read="brokers" admin="brokers" />
<authorizationEntry topic=">" write="brokers" read="brokers" admin="brokers" />
<authorizationEntry queue="mcollective.>" write="clients" read="clients" admin="clients" />
<authorizationEntry topic="mcollective.>" write="clients" read="clients" admin="clients" />
<authorizationEntry queue="mcollective.nodes" read="servers" admin="servers" />
<authorizationEntry queue="mcollective.reply.>" write="servers" admin="servers" />
<authorizationEntry topic="mcollective.*.agent" read="servers" admin="servers" />
<authorizationEntry topic="mcollective.registration.agent" write="servers" read="servers" admin="servers" />
<authorizationEntry topic="ActiveMQ.Advisory.>" read="everyone" write="everyone" admin="everyone" />
<authorizationEntry queue="eu.>" write="clients" read="clients" admin="clients" />
<authorizationEntry topic="eu.>" write="clients" read="clients" admin="clients" />
<!--
<authorizationEntry queue="eu.nodes" write="servers" read="servers" admin="servers" />
<authorizationEntry topic="eu.nodes" write="servers" read="servers" admin="servers" />
-->
<authorizationEntry topic="eu.*.agent" read="servers" admin="servers" />
<authorizationEntry queue="eu.reply.>" write="servers" admin="servers" />
<authorizationEntry queue="ap.>" write="clients" read="clients" admin="clients" />
<authorizationEntry topic="ap.>" write="clients" read="clients" admin="clients" />
<!--
<authorizationEntry queue="ap.nodes" write="servers" read="servers" admin="servers" />
<authorizationEntry topic="ap.nodes" write="servers" read="servers" admin="servers" />
-->
<authorizationEntry topic="ap.*.agent" read="servers" admin="servers" />
<authorizationEntry queue="ap.reply.>" write="servers" admin="servers" />
<authorizationEntry queue="us.>" write="clients" read="clients" admin="clients" />
<authorizationEntry topic="us.>" write="clients" read="clients" admin="clients" />
<!--
<authorizationEntry queue="us.nodes" write="servers" read="servers" admin="servers" />
<authorizationEntry topic="us.nodes" write="servers" read="servers" admin="servers" />
-->
<authorizationEntry topic="us.*.agent" read="servers" admin="servers" />
<authorizationEntry queue="us.reply.>" write="servers" admin="servers" />
</authorizationEntries>
</authorizationMap>
</map>
</authorizationPlugin>
</plugins>
<!--
The systemUsage controls the maximum amount of space the broker will
use before disabling caching and/or slowing down producers. For more information, see:
http://activemq.apache.org/producer-flow-control.html
-->
<systemUsage>
<systemUsage>
<memoryUsage>
<memoryUsage percentOfJvmHeap="70" />
</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>
<transportConnector name="openwire" uri="tcp://0.0.0.0:61616" />
<transportConnector name="stomp+nio" uri="stomp+nio://0.0.0.0:61613" />
<!-- DOS protection, limit concurrent connections to 1000 and frame size to 100MB -->
<!--
<transportConnector name="openwire" uri="tcp://0.0.0.0:61616?maximumConnections=1000&amp;wireFormat.maxFrameSize=104857600"/>
<transportConnector name="stomp+nio" uri="stomp://0.0.0.0:61613?maximumConnections=1000&amp;wireFormat.maxFrameSize=104857600"/>
-->
</transportConnectors>
<networkConnectors>
<networkConnector name='ap' duplex="true" uri='static:(tcp://192.168.50.11:61616)' userName='broker' password='8DM6iJxGw7NDu53vVbd9kaZhHLO2OKVNc5gyMDCEBw8=' />
<networkConnector name='us' duplex="true" uri='static:(tcp://192.168.50.31:61616)' userName='broker' password='8DM6iJxGw7NDu53vVbd9kaZhHLO2OKVNc5gyMDCEBw8=' />
</networkConnectors> <!-- destroy the spring context on shutdown to stop jetty -->
<shutdownHooks>
<bean xmlns="http://www.springframework.org/schema/beans" class="org.apache.activemq.hooks.SpringContextHook" />
</shutdownHooks>
</broker>
<!--
Enable web consoles, REST and Ajax APIs and demos
The web consoles requires by default login, you can disable this in the jetty.xml file
Take a look at ${ACTIVEMQ_HOME}/conf/jetty.xml for more details
-->
</beans>
# general settings
direct_addressing = 1
# ActiveMQ connector settings
connector = activemq
plugin.activemq.pool.size = 1
plugin.activemq.pool.1.host = 192.168.50.21
plugin.activemq.pool.1.port = 61613
plugin.activemq.pool.1.user = client
plugin.activemq.pool.1.password = 'secret'
plugin.activemq.heartbeat_interval = 30
# Security provider
securityprovider = psk
plugin.psk = 'secret'
# Use auto-discovery
default_discovery_method = mc
direct_addressing_threshold = 10
# misc settings
color = 1
rpclimitmethod = first
# Performance settings
direct_addressing_threshold = 10
ttl = 60
main_collective = mcollective
collectives = mcollective,ap,eu,us
libdir = /usr/libexec/mcollective
Hosts are:
amq_ap_master: 192.168.50.11
amq_eu_master: 192.168.50.21
amq_us_master: 192.168.50.31
node_ap: 192.168.50.12
node_eu: 192.168.50.22
node_us: 192.168.50.32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment