3 Replies Latest reply on May 4, 2014 4:51 PM by Wolf-Dieter Fink

    Load-balancing EJB calls from an EJB client

    Dejan Mitrovic Newbie

      I'm using a JBoss cluster with a number of EJB components deployed on it. I've noticed the following:

      • If I perform a JNDI lookup from an external client, the load-balancing process works as expected (i.e. a random cluster node is selected and the EJB is executed there)
      • If the client is one of the EJBs (i.e. one EJB invokes another), the target EJB is always executed on the same machine as the caller


      Is it possible to have the load-balancing feature in the second scenario as well? Both the external client and the calling EJB use remote interfaces only (the code is practically the same). None of the EJBs is marked with @LocalBean.


      I'm using asynchronous EJB invocation. If I employ JMS instead and call the target from a message-driven bean, I get the desired behavior, but the performance deteriorates.


      Please let me know if you need any additional information.