9 Replies Latest reply on Sep 15, 2011 9:25 PM by amathewjboss1

    Explicit routing (load balancing) issue in JBoss 5.1

    amathewjboss1

      Hi,

       

      We are running Jboss 5.1 in a clustered environment with 3 app servers(nodes). We are running into a issue where our application needs to a do a explicit route to a different server during a EJB call. i.e We have a client (back ground process) calls a EJB Method A (via remote bean call) and this Method A will call Method B within the app tier (same JVM). When the Method A calls Method B, we are trying to route Method B EJB call to a specific node(server). Note that when we make the Mathod A to Method B call, we are grabbing the “remote” home and doing a “create” on that home, attempting to get the remote interface/bean. We do have a custom load balancing policy class which does the routing process. Note that above mentioned Method A and Method B are 2 different EJB's.

       

      With JBoss 5.1, the load balancing policy class (i.e chooseTarget method) is not really executing and hence the explicit routing is not happening. This was working fine in Jboss 4.x.

       

      Can some one please help me with your thoughts? Unfortunately we found this issue just 2 days before we planned to upgrade our production servers to JBoss 5.1. I spend many hours in the forum to find an answer, but i couldn't. So any help will be highly appreciated.

       

       

      Thanks in Advance

      Anil Mathew

        • 1. Re: Explicit routing (load balancing) issue in JBoss 5.1
          pferraro

          Can you pastebin your custom load balance policy and jboss.xml containing the configuration of the relevant beans?

          • 2. Re: Explicit routing (load balancing) issue in JBoss 5.1
            amathewjboss1

            Thank you so much Paul for the response.

             

            Please see the attached file which has my load balancing class and the Jboss.xml entry for Beans.

             

            Like i mentioned, when the EJB Method A calls the EJB Method B i would expect the call to go through the 'chooseTarget" method in my EJBRouterJBoss.java class. But this is not happening.

             

            Thanks Again

            Anil Mathew

            • 3. Re: Explicit routing (load balancing) issue in JBoss 5.1
              amathewjboss1

              I have done so much testing to figure this out from yesterday. It seems like even though we are grabbing the “remote” home and doing a “create” on that home, attempting to get the remote interface/bean during the EJB A to EJB B call, i could see the below class in my debug stacktrace:

               

               

              org.jboss.ejb.plugins.local.StatelessSessionProxy.invoke(StatelessSessionProxy.java:103)

               

              I wonder this means the JBoss 5.1 is making my remote call to a local call.

               

              I am totally stuck at this point and I really have no more ideas on my mind. Can some one please share your thoughts.

               

              Thanks

              Anil Mathew

               

              • 4. Re: Explicit routing (load balancing) issue in JBoss 5.1
                jaikiran

                Anil Mathew wrote:

                 

                When the Method A calls Method B, we are trying to route Method B EJB call to a specific node(server). Note that when we make the Mathod A to Method B call, we are grabbing the “remote” home and doing a “create” on that home, attempting to get the remote interface/bean.

                Can you post that relevant code and also the exact bean definitions including the annotations/DD?

                 

                 

                Anil Mathew wrote:

                 

                With JBoss 5.1, the load balancing policy class (i.e chooseTarget method) is not really executing and hence the explicit routing is not happening. This was working fine in Jboss 4.x.

                 

                When are you expecting that chooseTarget of your policy to be called? When you invoke the "create" on the home interface or when you invoke a business method on the remote interface returned by create?

                • 5. Re: Explicit routing (load balancing) issue in JBoss 5.1
                  jaikiran

                  Anil Mathew wrote:

                   

                  org.jboss.ejb.plugins.local.StatelessSessionProxy.invoke(StatelessSessionProxy.java:103)

                   

                  You are using EJB2.x and not EJB3?

                  • 6. Re: Explicit routing (load balancing) issue in JBoss 5.1
                    jaikiran

                    See "Why are calls between clustered session beans not load balanced even though load balancing policy is Round Robin?" here http://community.jboss.org/wiki/ClusteringFAQ

                    • 7. Re: Explicit routing (load balancing) issue in JBoss 5.1
                      amathewjboss1

                      Thank You Jaikiran for your reply.

                       

                      Please see the attached file which has my load balancing class and the Jboss.xml entry for Beans.

                       

                      Like i mentioned on my earlier post, when the EJB Method A calls the EJB Method B i would expect the call to go through the 'chooseTarget" method in my EJBRouterJBoss.java class. But this is not happening.

                       

                      After more digging on the forum, i was able to get this one - http://community.jboss.org/message/209981#209981 and i think this is what i wanted. But this seems to be a "hack" for me. Do you know if we can just disable this feature of "JBoss's intra-VM EJB optimization, where it will use a local EJB even for a remote call if the reqested EJB is deployed on the local server" in JBoss 5.1 and hence I don't have to go for the  

                      "JRMPInvokerHA" hack?

                       

                      Finally as a good note, we upgraded the production to Jboss 5.1 for one of our application (more to go in the days to come).  Thank you for all your answers and thoughts.

                       

                      Anil Mathew

                      • 8. Re: Explicit routing (load balancing) issue in JBoss 5.1
                        amathewjboss1

                        Hi Jaikiran,

                         

                            I am trying to see cluster-service.xml  in Jboss 5.1, but apparently we don't have this file on JBoss 5.1. Can you tell me which file replaces this on Jboss 5.1 please? In fact i am trying to change 'org.jboss.invocation.jrmp.server.JRMPInvokerHA' to MyJRMPInvokerHA.

                         

                        Thanks

                        Anil Mathew

                        • 9. Re: Explicit routing (load balancing) issue in JBoss 5.1
                          amathewjboss1

                          I just wanted to update this case by saying that my issue is fixed and i followed the same steps mentioned in http://community.jboss.org/message/209981#209981.

                           

                          I feel this is a "hack" and i hope the future AS will take care of this by just changing some configuration files.

                           

                          Thanks

                          Anil Mathew