You can specify multiple initial addresses from the clients, not just one.
And Apache can only load-balance HTTP, not HotRod.
Hey nadirx ,
I think something is wrong. I had two nodes, I put tejas.local.com down and then I wrote this code.
ConfigurationBuilder builder = new ConfigurationBuilder();
.callbackHandler(new MyCallbackHandler("AdminUser", "ApplicationRealm", "AdminPass".toCharArray()));
It gave me "org.infinispan.client.hotrod.exceptions.TransportException: Could not fetch transport , Caused by: org.infinispan.client.hotrod.exceptions.TransportException: Could not connect to server: tejas.local.com/192.168.156.104:11222" exception after waiting for some time. But when I removed tejas.local.com, it immediately worked, stored and retrieved the key. What's wrong here? I thought If it could not reach one node, it could still connect to the cluster as udit.local.com was up.
What Infinispan version are you using? If not using latest, could you try with latest pre-release version, 8.2.0.CR1?
By default the maximum number of retries is 10, which is possibly why it takes time for the exception to be reported, but it should really try out both nodes.
If still having issues using latest pre-release version, could please you enable TRACE on org.infinispan on the client and attach the log.
The version which I am using is the latest stable version i.e. 8.1.2
I changed the maxRetries to 1, now it takes less time, but still gives the error. Is it a known issue??
I am attaching the log file.
JBossClient.log.zip 897 bytes
Sorry galder.zamarreno , my Syntax was wrong. I forgot to chain .addServer() method while I was doing the configuration. Now it woks fine even if tejas.local.com is down.
Everything is cool, but it led me to one suspicion that suppose I have 20 nodes and I have their addresses as comma seperated values which comes from some property(dynamic, lets say a string named nodes). How would I construct the ConfigurationBuilder to take all those 20 nodes with the given syntax, even if I split the string, I can not write a loop or something. Alternatively, is there any method which takes a list of Servers ??
There's no such method at the moment, but you could send us a pull request to add it?
Hey galder.zamarreno ,
I found a method which could be helpful for me, its addServers whose syntax is -
Now, I have no issues, I can use dynamic properties.