Suppose I have a client which uses HAJNDI (JBoss 3.2.5, JDK 1.4.2_05, solaris) and the java.naming.provider.url is set to something like jnp://host1:1100,jnp:host2:1100,jnp://host3:1100. The client is set up to be run from a shell script a few thousand times in a given day. My question is how does the load-balancing work?
Basically I tried this setup and ran the client a couple of times and found that each client run seemed to go against a particular JBoss server. When I shut that server down, the clients picked a different server to go against. So the fail-over piece seems to work nicely. But how does the HAJNDI implementation deal with load-balancing?
I'd like to see client runs connect to different instances in the JBoss cluster. Is this possible to do? Am I misunderstanding how the clustering is supposed to work?
There is no loadbalancing of the initial lookup of the hajndi naming proxy using the java.naming.provider.url list. This is simply a bootstrap list of servers that will be tried in order. Once the hajndi naming proxy has been retrieved from a server, the jndi operations will be loaded balanced to however many nodes are in the cluster.