activemq-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Frank Meilinger" <frank.meilin...@gmx.net>
Subject replicated static master/slave - which is the correct URI for an artemis-jms-client?
Date Tue, 09 Jul 2019 21:49:30 GMT
Hello, 

I've followed the test setup and installed a replicated static master/slave environment (like
documented here: https://github.com/jbossdemocentral/amq-ha-replicated-demo). Version is Artemis
2.7.0. Both master and slave processes start without errors. 

Now I try to find out which is the correct URI using in a artemis-jms-client. 

      <dependency>
        <groupId>org.apache.activemq</groupId>
        <artifactId>artemis-jms-client</artifactId>
        <version>2.7.0</version>
      </dependency>

After doing a lot of Artemis document and google research, I've tried the following variants: 

tcp://master:61616?ha=true&reconnectAttempts=-1 
(tcp://master:61616,tcp://slave:61616)?ha=true&reconnectAttempts=-1 
failover:(tcp://master:61616,tcp://slave:61616)?ha=true&reconnectAttempts=-1 
(tcp://master:61616,tcp://slave:61616)?randomize=false&backup=true 
failover:(tcp://master:61616,tcp://slave:61616)?randomize=false&backup=true 

Nothing really works. The tested variants with "failover:" schema are not supported for this
client, as I can read in the error message. The other variants work, as long as the master
is running. When regular stopping (or killing with -9) the master, there are errors in the
client code and no transparent failover happens (session get's invalid and/or connection get's
invalid). 

I also tried to use these 5 different URI's with command line consumer and producer but I
have the same problems as in the artemis-jms-client. 

Here are my tests with the command line tools: 

Starting the consumer in one console: 
./artemis consumer --url "<one of the 5 URI's mentioned above>" --destination topic://abc.def
--message-count 10 --data /dev/stdout --durable --clientID myclient 

Starting the producer in an other console: 
./artemis producer --url "<one of the 5 URI's mentioned above>" --destination topic://abc.def
--message test --sleep 1000 --message-count 10 

While the command line producer is sending messages with 1 second delay and the command line
consumer receives them, I stop/kill the master and have hoped that the failover will happen
transparently. But I got more or less the same errors as in the artemis-jms-client. 

So my question is just, what is the correct syntax for the client URI to get transparent failover
for such a master/slave setup (working with both artemis-jms-client and command line clients)? 

Thanks in advance, 
Frank

Mime
View raw message