Hi Bruce,

I would say what you are running is not a master / slave pair, but just 
two parallel broker..
If the falover transport of the Consumer and Broker A point to different 
Brokers, you do not get Messages.

What you need is a locking mechanism.

Best Regards

Herbert
 
 




Von:    "Bruce Cooper" <[email protected]>
An:     [email protected]
Datum:  23.02.2024 03:24
Betreff:        [Ext] Issue with network of brokers and active/passive 
pair



Hi,

I'm running into a strange issue configuring activemq 5.17.6 to forward 
messages from a satellite broker to a pair of brokers running in an 
active/passive (failover) pair.  I'm hoping somebody here can help me

I have three brokers.  The first is running stand-alone, and is configured 
with a one way network bridge to the other two, who are operating in an 
active/passive (also known as master/slave) mode.  
                        /----> Broker B. <---\
Producer -> Broker A ---+                    +---- Consumer
                        \----> Broker C <----/

This works fine, up until I try to test what happens when the redundant 
pair is rebooted/goes down.  

My test procedure is this:
Start all brokers, and ensure that everything is connected
Run the producer script multiple times to send persistent messages to a 
queue, seeing that messages are delivered to the consumer, and printed 
out.
Shut down (via activemq stop cmd) the broker that the consumer is 
connected to (B)
Observe that the consumer reconnects to the other broker (C), as does the 
satellite broker (A)
Run the producer script again.
Observe that one set of messages is delivered
Run the producer script again - This time no messages are delivered.  
Messages are  accepted by Broker A, and it seems that it has forwarded 
them to broker C (The queue shows the same number of enqueued and dequeued 
messages in Broker A's console, as does the Network Connector), but no 
messages (apart from the first set) appear in Broker C's queue.
Get consumer to fail back to the original server (B) by restarting B, then 
stopping C
Any subsequent attempts to send messages fail.
Restart Broker A
Messages now flow, but any that were transmitted at step 7 have been lost

If I change the topology to remove Broker C and restart Broker B, messages 
are appropriately queued, forwarded and delivered to the consumer once it 
reconnects after the restart.  It behaves as expected.

The configuration for the brokers is the default example configuration, 
except that Broker B and C use the same persistenceAdapter kahaDB 
directory and broker A has a network Connector that looks like

<networkConnectors>
    <networkConnector name="laptop" uri="static:failover:(tcp://
100.127.41.128:61616,tcp://100.127.41.128:61617)" duplex="false" 
staticBridge="true" userName="bruce" password="sekrit" networkTTL="10">
        <staticallyIncludedDestinations>
            <queue physicalName="TestQueue"/>
        </staticallyIncludedDestinations>
    </networkConnector>
</networkConnectors>


I have attached the configuration files for reference, along with the test 
program I am using to send and receive. 

What am I doing wrong?


-- 
https://mechination.com.au/
Ph: 0448 341 729[Anhang "nodeA.xml" gelöscht von Herbert 
Helmstreit/RG/SYSTEMA/DE] [Anhang "nodeC.xml" gelöscht von Herbert 
Helmstreit/RG/SYSTEMA/DE] [Anhang "nodeB.xml" gelöscht von Herbert 
Helmstreit/RG/SYSTEMA/DE] 



Reply via email to