简体   繁体   中英

Apache ActiveMQ ignoring randomize=false and other parameters

I am currently using NMS (C#), and I provide it with three server addresses with a priority server with the expectation for it to connect to the 2nd or 3rd server when the main is offline and then re-connect with the main server once back online.

The servers are third-party hosted whereas I'm developing the client.

I am using the following nugets:

  • Apache.NMS.ActiveMQ (1.8.0)
  • Apache.NMS (1.8.0)
  • Broker version 5.16.2 - 5.16.4

Connection string:

failover:(tcp://mainServer:61619,tcp://backup1:61619,tcp://backup2:61619)?randomize=false&timeout=10000&backup=true&priorityBackup=true&useExponentialBackOff=true&reconnectDelayExponent=2.0&initialReconnectDelay=5000&initialReconnectDelay=180000&consumerExpiryCheckEnabled=false

I'm providing it with randomize=false but yet it is still selecting a server a random and it does not seem to set the useExponentialBackOff either.

I have also tried nested.randomize=false

The NMS.ActiveMQ client is different than the Java client in that URI options require prefixes in order for the parser to figure out how to apply them. For the failover options the prefix is "transport." eg "transport.randomize=false". This is documented on the website for the NMS.ActiveMQ client here .

To my recollection the NMS.ActiveMQ client doesn't support the priority backup options (and they aren't on the site) so that probably won't work as you are expecting it to.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM