2 Replies Latest reply on Mar 11, 2004 6:29 AM by Ron Emrick

    Accessing Clustered Servers via client code

    Ron Emrick Newbie


      There is quite a bit of discussion (and confusion I believe) in how to connect from a java client (whether it be a Java app, servlet or JSP) to a JBoss instance that happens to be clustered. I am seeing lots of discussion on just exactly how to create the proper JNDI Properties to pass to InitialContext().

      Before I embark on this adventure, I'd like to see if I can save myself (and others) time by getting clear and concise details on just exactly what is required. Can anyone help provide some guidance based on previous experience?

      Some questions I have now are:
      1) Can I simply leave my existing code as is as long as I am running the clustered JBoss instances (run -c all)?
      2) One example I saw in this forum used the following in relation to creating the InitialContext():

       // to lookup on all servers, if apps2 goes down, it will lookup on apps3.
       // to lookup on a specific server, not recommended as this does not make use
       // of the clustering (unless you have different groups of server that serve different
       // functions, and then you would still lookup on more than 1)
       InitialContext jndiContext = new InitialContext(p);

      Is this needed? Seems like this makes more sense then doing nothing at all.

      3) How do I access from the client a SingletonService configured MBean?

      Unfortunately the JBoss Clustering documentation does not cover this topic and takes it for granted.