You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@activemq.apache.org by Shahzad Bhatti <bh...@plexobject.com> on 2009/05/19 00:35:00 UTC

Setting up network of brokers without shared database or file system

I am using ActiveMQ 5.2 with following configuration:
  <broker brokerName="US_Integ_RSP" persistent="true" useJmx="true"
xmlns="http://activemq.apache.org/schema/core">
        <!-- Destination specific policies using destination names or
wildcards -->
        <destinationPolicy>
            <policyMap>
                <policyEntries>
                    <policyEntry queue=">" memoryLimit="512mb">
                        <deadLetterStrategy>
                        <individualDeadLetterStrategy queuePrefix="DLQ." />
                        </deadLetterStrategy>
                    </policyEntry>
                    <policyEntry topic=">" memoryLimit="128mb">
                        <dispatchPolicy>
                            <strictOrderDispatchPolicy/>
                        </dispatchPolicy>
                        <subscriptionRecoveryPolicy>
                            <lastImageSubscriptionRecoveryPolicy/>
                        </subscriptionRecoveryPolicy>
                    </policyEntry>
                </policyEntries>
            </policyMap>
        </destinationPolicy>
        <!-- Use the following to configure how ActiveMQ is exposed in JMX
-->
        <managementContext>
            <managementContext createConnector="true"/>
        </managementContext>
    <persistenceAdapter>
        <journaledJDBC journalLogFiles="5" dataDirectory="./var/" />
    </persistenceAdapter>

    <transportConnectors>
        <transportConnector name="openwire" uri="tcp://localhost:61616"
discoveryUri="multicast://default"/>
    </transportConnectors>

    <networkConnectors>
      <networkConnector name="default-us-integ-rsp"
uri="multicast://default" dynamicOnly="true" conduitSubscriptions="false"
decreaseNetworkConsumerPriority="false" />
    </networkConnectors>

I am using two activemq servers and connecting to them from Spring using URL

prod.USAmazon.JmsBrokerUrl="failover://(tcp://rspp-prod-na-0104.sea3.amazon.com:61616,tcp://rspp-prod-na-1007.vdc.amazon.com:61616?trace=false)?initialReconnectDelay=100";


and then registering listener as 

  <bean
class="org.springframework.jms.listener.DefaultMessageListenerContainer"
init-method="start" destroy-method="stop">
        <property name="connectionFactory"
ref="staticJmsConnectionFactory"/>
        <property name="destination" ref="responseQueue"/>
        <property name="messageListener" ref="asyncResponseAdapter"/>
        <property name="concurrentConsumers" value="1"/>
        <property name="sessionTransacted" value="true"/>
   </bean>

However, I am getting connected to only one of the server. If I increase
concurrentConsumers to higher value, I see that I am connected to both, but
is there a way to connect to both servers with only 1 consumer. Now, the
publisher might connect to one of the server and add the message to the
queue, but listener is on the other side. My question is that how do I setup
network of brokers to pass message to the right consumer.



-- 
View this message in context: http://www.nabble.com/Setting-up-network-of-brokers-without-shared-database-or-file-system-tp23606575p23606575.html
Sent from the ActiveMQ - User mailing list archive at Nabble.com.