0 Replies Latest reply on Feb 22, 2006 4:59 PM by jsicotte2

    SLSB Server Side Load Balancing

      I am using JBoss 4.0.4RC1 and trying to leverage round-robin load balancing for dividing up work that needs to be performed server side. My approach is to have two EJB classes: EJBWork, and EJBWorker. EJBWork will get though HA-JNDI a reference to EJBWorker and submit parts of the job to execute to that bean. There is only one instance of EJBWork in the cluster, and many instances of EJBWorker. Using the smart stub returned from HA-JNDI, the EJBWork bean will distribute the job among the cluster nodes that have the EJBWork bean deployed.

      As per the JBoss documentation, EJBWork looks up EJBWorker using the HA-JNDI port passed to the InitialContext:

      Properties p = new Properties();
      p.put(Context.INITIAL_CONTEXT_FACTORY,"org.jnp.interfaces.NamingContextFactory");
      p.put(Context.URL_PKG_PREFIXES, "jboss.naming:org.jnp.interfaces");
      p.put(Context.PROVIDER_URL, "localhost:1100");
      return new InitialContext(p);
      


      My problem is that EJBWork never gets the smart stub and delegates work only to the EJBWorker bean that is deployed in the same JBoss instance. After looking though the forums I found this post:

      http://www.jboss.com/index.html?module=bb&op=viewtopic&t=14030

      I may be reading this incorrectly, but it seems to me that using load balancing from the client side works, but does not work from the server side. Am I correct?