Hi all,

I also have the same problem as Pieter but using Active MQ 4.1.1.

My application requires messages to be sent from one site to another,
but he network connections may not be available.
Each site has its own instance of ActiveMQ running which is always
available. (ActiveMQ is required for other applications so it cannot be
run as an embedded broker.)
Each site has a queue on which it receives its messages and can send on
all the other queues at the other sites.
Head office has an instance of ActiveMQ which acts as a bridge between
sites and their queues.
Sites do not communicated directly with each other.

I can successfully send and receive messages from one site to another
and on the correct queue for the site.  Also I cannot receive back
messages that were sent on other queues (which is the behavior I want)

The problem occurs when I bring down the Head Office ActiveMQ instance
(either by shutting down or breaking the network connection).  
When I bring the Head Office instance back up, messages are no longer
routed to their destinations and can be received locally.  I also get
repeating messages.

To get the message routing to work again, I must bring up all the sites
in the order Head Office, site 1, site 2 , etc.

I have provided the configurations I use below:

I would appreciate any suggestions

As a matter of interest, this project is for a winery and the system
spans three states in Australia.

Thank you,
Steven Dalton


For Head Office I have the following configuration:

<beans>
  <bean
class="org.springframework.beans.factory.config.PropertyPlaceholderConfi
gurer"/>  
  <broker brokerName="HeadOffice" useJmx="false"
xmlns="http://activemq.org/config/1.0";>

  <persistenceAdapter>
        <journaledJDBC journalLogFiles="5"
dataDirectory="${activemq.base}/activemq-data"/>
    </persistenceAdapter>
  
    <transportConnectors>
       <transportConnector name="openwire" uri="tcp://localhost:61616"/>
    </transportConnectors>

    <networkConnectors> 
      <networkConnector
uri="static:failover:(tcp://Site1:61616,tcp://Site2:61616)"
name="bridge1" networkTTL="2">
                <staticallyIncludedDestinations>
                        <queue physicalName="QUEUEB"/>
</staticallyIncludedDestinations>
       </networkConnector>
      <networkConnector uri="static:failover:(tcp://
Site2:61616,tcp://Site1:61616)" name="bridge2" networkTTL="2">
                <staticallyIncludedDestinations>
                        <queue physicalName="QUEUEA"/>
</staticallyIncludedDestinations>
       </networkConnector>
     </networkConnectors>       
  </broker>
</beans>


For site#1 I have the following configuration:

<beans>
  <bean
class="org.springframework.beans.factory.config.PropertyPlaceholderConfi
gurer"/>  
  <broker brokerName="Site1" useJmx="false"
xmlns="http://activemq.org/config/1.0";>

  <persistenceAdapter>
        <journaledJDBC journalLogFiles="5"
dataDirectory="${activemq.base}/activemq-data"/>
    </persistenceAdapter>
  
    <transportConnectors>
       <transportConnector name="openwire" uri="tcp://Site1:61616"/>
    </transportConnectors>

    <networkConnectors>
      <networkConnector name="Site1 and HeadOffice"
uri="static:failover:(tcp://localhost:61616,tcp:// HeadOffice:61616)"
networkTTL="2">
                <staticallyIncludedDestinations>
                        <queue physicalName="QUEUEA"/>
                        <queue physicalName="QUEUEB"/>
                </staticallyIncludedDestinations>
          </networkConnector>
        </networkConnectors>            
  </broker>
</beans>

For site#2 I have the following configuration:

<beans>
  <bean
class="org.springframework.beans.factory.config.PropertyPlaceholderConfi
gurer"/>  
  <broker brokerName=" Site2" useJmx="false"
xmlns="http://activemq.org/config/1.0";>

  <persistenceAdapter>
        <journaledJDBC journalLogFiles="5"
dataDirectory="${activemq.base}/activemq-data"/>
    </persistenceAdapter>
  
    <transportConnectors>
       <transportConnector name="openwire" uri="tcp://Site2:61616"/>
    </transportConnectors>

    <networkConnectors>
      <networkConnector name="Site2 and HeadOffice"
uri="static:failover:(tcp://localhost:61616,tcp:// HeadOffice:61616)"
networkTTL="2">
                <staticallyIncludedDestinations>
                        <queue physicalName="QUEUEA"/>
                        <queue physicalName="QUEUEB"/>
                </staticallyIncludedDestinations>
          </networkConnector>
        </networkConnectors>            
  </broker>
</beans>


-----Original Message-----
From: PieterN [mailto:[EMAIL PROTECTED] 
Sent: Friday, 22 June 2007 11:26 PM
To: users@activemq.apache.org
Subject: Weird problem with network of brokers


Hi,

I've encountered a weird problem with a network of brokers setup. I have
two
activemq servers, local and remote. Each connect to eachother with a
static
networkConnector configurator. I have a consumer connecting to one of
the
servers, with a durable subscription on a topic. Everything works as
expected: the consumer receives messages sent to either server, no
matter to
which server is connected.

The problem comes when i kill one server, say the server 'remote'. The
consumer can continue on the server 'local' without any problems.
Messages
sent to 'local' are received. When I start 'remote' again, the problem
faces: if I connect the consumer to 'remote', I keep receiving the
messages
over and over again, even though I ACK each message. The only way to
stop
this, is to kill both servers, and remove their data directories (both
brokers have the persistent flag set). All messages are also persistent.

Am I doing something wrong? I searched JIRA, but couldn't find any
related
issues. Is this a bug? This way 
the network of brokers feature is not very useful, I want to restart
crashed/killed brokers without needing to stop the other brokers first.

Regards,

Pieter
-- 
View this message in context:
http://www.nabble.com/Weird-problem-with-network-of-brokers-tf3964843s23
54.html#a11252769
Sent from the ActiveMQ - User mailing list archive at Nabble.com.


Reply via email to