Hello all,

We are using activemq 5.1.0 in a linux environment and 1.5.0 jvm with a network 
of brokers. Our activemq.xml file is attached, and it is mirrored on the other 
broker (we found that duplex=true didn't work for us, as it forwarded ALL 
queues, regardless of settings).  Note that we also tried this with the latest 
5.2.0 snapshot and no change in behavior.

The scenario is that there is one consumer producing to server 1 and one 
consumer on server 1 and one consumer on server 2.

Here is how we would like for our network of brokers to function:
1) Send approximately equal number of messages to server 1 and server 2 to 
allow both consumers to consume.
2) If a consumer on one server or the other dies, re-deliver messages to the 
other server.

We would like this to be the case whether the consumers are listening or 
polling the servers.

Here is how it does behave in eclipse running the attached JUnit tests:
1) If there are two Consumers are polling consumers with a receive timeout 
around 5000ms, it behaves as desired.
2) If consumers are listeners, then all messages are delivered to server 1 and 
none are forwarded to server 2.
3) If a consumer consumes half the messages on server 1, and a second consumer 
consumes a fourth of the messages on server 2, and then a third consumer is 
started attempting to receive the remaining quarter on server 1, the messages 
are not redelivered and remain on server 2 even though there are no consumers.

I used the ConsumerTool.java as the base code for my consumers, but I did 
change it a little.  I don't think I changed it in any substantive way, yet it 
behaves differently in eclipse and the command line.  The changes made were 
meant to allow easier configuration within the test cases and also to enforce a 
maximum number of received messages.

Here is how it behaves on the commandline java examples in the examples 
directory (and separate php clients we wrote):
1) If there are two Consumers are polling consumers no matter the receive 
timeout, messages are not delivered to server 2 until the consumer on server 1 
is disconnected, at which point ALL queued messages are delivered to server 2 
and never come back to server 1 no matter which clients are disconnected and 
reconnected.
2) same as eclipse.
3) same as eclipse.

I don't have a test case for the commandline behavior, but the JUnit tests are 
attached.

Does anyone have any suggestions for me, or even an explanation for why the 
JUnit tests and command line behavior is different?

Thanks,
Gabe
<?xml version="1.0"?>
<beans xmlns="http://www.springframework.org/schema/beans";>
  <bean class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer"/>
  <broker xmlns="http://activemq.org/config/1.0"; dataDirectory="${activemq.base}/data" brokerName="arch3.bmdc.mlsrvr.com">
    <persistenceAdapter>
      <jdbcPersistenceAdapter dataSource="#mysql-ds"/>
    </persistenceAdapter>
    <transportConnectors>
      <transportConnector name="openwire" discoveryUri="multicast://default" uri="tcp://arch3.bmdc.mlsrvr.com:61616"/>
      <transportConnector name="ssl" uri="ssl://arch3.bmdc.mlsrvr.com:61617"/>
      <transportConnector name="stomp" uri="stomp://arch3.bmdc.mlsrvr.com:61613"/>
      <transportConnector name="stomp+ssl" uri="stomp+ssl://arch3.bmdc.mlsrvr.com:61612"/>
      <transportConnector name="xmpp" uri="xmpp://arch3.bmdc.mlsrvr.com:61222"/>
    </transportConnectors>
   <networkConnectors>
      <networkConnector uri="static://(tcp://arch3.bmdc.mlsrvr.com:61616,tcp://arch4.bmdc.mlsrvr.com:61616)"
         name="devbridge"
         dynamicOnly="true"
         networkTTL="6"
         conduitSubscriptions="false"
         decreaseNetworkConsumerPriority="false"
         >
         <excludedDestinations>
                <queue physicalName="Provisioning*" />
         </excludedDestinations>
        <dynamicallyIncludedDestinations>
                <queue physicalName="amqTest.*"/>
        </dynamicallyIncludedDestinations>
        <staticallyIncludedDestinations>
                <queue physicalName="TEST.*"/>
        </staticallyIncludedDestinations>
      </networkConnector>
        <!--                                                                                                                                                 
<networkConnector uri="static://(tcp://arch3.bmdc.mlsrvr.com:61616)"                                                                                         
                name="devbridge2"                                                                                                                            
                dynamicOnly="true"                                                                                                                           
                networkTTL="5"                                                                                                                               
                conduitSubscriptions="false" >                                                                                                               
        <excludedDestinations>                                                                                                                               
                <queue physicalName="Provisioning*" />                                                                                                       
        </excludedDestinations>                                                                                                                              
        <dynamicallyIncludedDestinations>                                                                                                                    
                <queue physicalName="TEST.*" />                                                                                                              
        </dynamicallyIncludedDestinations>                                                                                                                   
       </networkConnector>                                                                                                                                   
-->
    </networkConnectors>
    <managementContext>
      <managementContext connectorPort="1099" jmxDomainName="org.apache.activemq"/>
    </managementContext>
  </broker>
  <jetty xmlns="http://mortbay.com/schemas/jetty/1.0";>
    <connectors>
      <nioConnector port="8161"/>
    </connectors>
    <handlers>
      <webAppContext contextPath="/admin" logUrlOnStart="true" resourceBase="${activemq.base}/webapps/admin"/>
      <webAppContext contextPath="/demo" logUrlOnStart="true" resourceBase="${activemq.base}/webapps/demo"/>
    </handlers>
  </jetty>
  <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:///activemq?relaxAutoCommit=true"/>
    <property name="username" value="activemq"/>
    <property name="password" value=""/>
    <property name="poolPreparedStatements" value="true"/>
  </bean>
</beans>

Attachment: amqTester.tar.gz
Description: GNU Zip compressed data

Reply via email to