On Mon, Mar 30, 2015 at 4:57 PM, wonderkind <kevin...@am.sony.com> wrote:
> Do you have a sample activemq.xml configuration file you could share for
your 3 x 3 cluster?   I am trying to do the same, with everything running
on my Mac initially.

On the amq-prod-1 cluster my network connector url is

masterslave:(tcp://amq-prod-2a:61616,tcp://amq-prod-2b:61616,tcp://amq-prod-2c:61616)

On the amq-prod-2 cluster my network connector url is:

masterslave:(tcp://amq-prod-1a:61616,tcp://amq-prod-1b:61616,tcp://amq-prod-1c:61616)

The following are the messages I get in my log:

2015-03-30 17:38:00,236 [ActiveMQ Task-1] INFO  DiscoveryNetworkConnector
   - Establishing network connection from
vm://amq-prod-1?async=false&network=true to
failover:(tcp://amq-prod-2a:61616,tcp://amq-prod-2b:61616,tcp://amq-prod-2c:61616)?randomize=false&maxReconnectAttempts=0
2015-03-30 17:38:00,450 [ActiveMQ Task-1] INFO  FailoverTransport
   - Successfully connected to tcp://amq-prod-2b:61616
2015-03-30 17:38:00,767 [//amq-prod-1#42] INFO
 DemandForwardingBridgeSupport  - Network connection between
vm://amq-prod-1#42 and tcp://amq-prod-2b:61616 (amq-prod-2) has been
established.

Here's a full example of the config:

<?xml version="1.0"?>
<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";>

    <!-- Allow the use of  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>

    <broker
xmlns="http://activemq.apache.org/schema/core";
useJmx="true"
brokerName="amq-prod-1">

<managementContext>
    <!-- http://activemq.apache.org/jmx.html -->
            <!-- Do not use the legacy JMX Connector. -->
    <managementContext createConnector="false" />
</managementContext>

<persistenceAdapter>
    <!-- http://activemq.apache.org/replicated-leveldb-store.html -->
    <replicatedLevelDB
replicas="3"
zkSessionTimeout="5s"
zkPath="/activemq/amq-prod-1"
zkAddress="zk1.example.org:2181,zk2.example.org:2182,zk3.example.org:2181,
zk4.example.org:2181,zk5.example.org:2181,zk6.example.org:2181" />
</persistenceAdapter>
 <plugins>
    <!-- http://activemq.apache.org/statisticsplugin.html -->
    <statisticsBrokerPlugin/>
</plugins>

        <!-- http://activemq.apache.org/producer-flow-control.html -->
<systemUsage>
    <systemUsage>
<memoryUsage>
    <memoryUsage percentOfJvmHeap="70"/>
</memoryUsage>
<storeUsage>
    <storeUsage limit="6 gb"/>
</storeUsage>
<tempUsage>
    <tempUsage limit="2 gb"/>
</tempUsage>
    </systemUsage>
</systemUsage>

<!-- http://activemq.apache.org/producer-flow-control.html -->
<!-- http://activemq.apache.org/message-cursors.html -->
<destinationPolicy>
    <policyMap>
<policyEntries>
    <policyEntry topic=">" memoryLimit="1mb">
    </policyEntry>
    <policyEntry queue=">" memoryLimit="1mb" optimizedDispatch="true">
    </policyEntry>
</policyEntries>
    </policyMap>
</destinationPolicy>

<!-- http://activemq.apache.org/configuring-transports.html -->
<transportConnectors>
    <transportConnector name="openwire" uri="nio://0.0.0.0:61616"/>
    <transportConnector name="stomp+nio" uri="stomp+nio://0.0.0.0:61613"/>
    <transportConnector name="amqp" uri="amqp+nio://0.0.0.0:5672"/>
</transportConnectors>

<!-- http://activemq.apache.org/networks-of-brokers.html -->
        <!-- networkTTL is based on the number of clusters networked
together -->
<networkConnectors>
<networkConnector
uri="masterslave:(tcp://amq-prod-2a:61616,tcp://amq-prod-2b:61616,tcp://amq-prod-2c:61616)"
consumerTTL="1" messageTTL="-1" decreaseNetworkConsumerPriority="true" />
</networkConnectors>

<shutdownHooks>
    <!-- Shut down the jetty based web console application. -->
    <bean xmlns="http://www.springframework.org/schema/beans";
class="org.apache.activemq.hooks.SpringContextHook"/>
</shutdownHooks>
    </broker>

    <import resource="jetty.xml"/>
</beans>

Reply via email to