6 Replies Latest reply on Sep 2, 2005 11:29 AM by jason1

    client-side invoker load-balance logic in code?

      I am trying to track down why my client will not load-balance between clustered servers. I have debugged all the way through to JMRPInvoker_Stub Unicast.invoke() and cannot see any load-balancig logic. Can someone point me to the exact class and lines of code that should be executed when load-balancing in RoundRobin fashion?

      thanks!

        • 1. Re: client-side invoker load-balance logic in code?

          Hmmm... org.jboss.invocation.jrmp.server.JRMPInvokerHA ?? Too bad I don't see this in my debugger. I guess that might be why it is not loadbalancing properly.

          I've defined my SLSB as "Clustered Stateless SessionBean" from standardjboss.xml. I figured that would through the JRMPInvokerHA into the mix for me.

          • 2. Re: client-side invoker load-balance logic in code?

            Can you post your jboss.xml from your ejb jar?

            • 3. Re: client-side invoker load-balance logic in code?

              Here it is. The EJB in question is DelegateSLSBean. It has a configured container of "DelegateSLSBean Clustered Container" which extends a clustered container in standardjboss.xml.

              <?xml version="1.0" encoding="UTF-8"?>
              <!DOCTYPE jboss PUBLIC "-//JBoss//DTD JBOSS 4.0//EN" "http://www.jboss.org/j2ee/dtd/jboss_4_0.dtd">
              
              <jboss>
              
               <unauthenticatedPrincipal>guest</unauthenticatedPrincipal>
              
               <enterprise-beans>
              
               <message-driven>
               <ejb-name>DelegateTopicChannelMDB</ejb-name>
               <destination-jndi-name>topic/DelegateTopic</destination-jndi-name>
               <mdb-user>GUEST</mdb-user>
               <mdb-passwd>password</mdb-passwd>
               <configuration-name>DelegateTopicChannelMDB Container</configuration-name>
               <resource-ref>
               <res-ref-name>mail/MailSession</res-ref-name>
               <jndi-name>java:/Mail</jndi-name>
               </resource-ref>
               </message-driven>
               <message-driven>
               <ejb-name>DelegateQueueChannelMDB</ejb-name>
               <destination-jndi-name>queue/DelegateQueue</destination-jndi-name>
               <mdb-user>GUEST</mdb-user>
               <mdb-passwd>password</mdb-passwd>
               <configuration-name>DelegateQueueChannelMDB Container</configuration-name>
               <resource-ref>
               <res-ref-name>mail/MailSession</res-ref-name>
               <jndi-name>java:/Mail</jndi-name>
               </resource-ref>
               </message-driven>
               <message-driven>
               <ejb-name>CommChannelMDB</ejb-name>
               <destination-jndi-name>queue/CommServerQueue</destination-jndi-name>
               <mdb-user>GUEST</mdb-user>
               <mdb-passwd>password</mdb-passwd>
               <configuration-name>CommChannelMDB Container</configuration-name>
               <ejb-local-ref>
               <ejb-ref-name>ejb/Delegate</ejb-ref-name>
               <jndi-name>DelegateSLSBeanLocal</jndi-name>
               </ejb-local-ref>
               </message-driven>
              
               <message-driven>
               <ejb-name>LogChannelMDB</ejb-name>
               <destination-jndi-name>queue/LogQueue</destination-jndi-name>
               <mdb-user>GUEST</mdb-user>
               <mdb-passwd>password</mdb-passwd>
               <configuration-name>LogChannelMDB Container</configuration-name>
               <ejb-local-ref>
               <ejb-ref-name>ejb/Log</ejb-ref-name>
               <local-jndi-name>LogSLSBean</local-jndi-name>
               </ejb-local-ref>
               <depends>application.system:service=UniqueIDGenerator</depends>
               </message-driven>
               <message-driven>
               <ejb-name>RtmsResponseChannelMDB</ejb-name>
               <destination-jndi-name>queue/RtmsResponseQueue</destination-jndi-name>
               <mdb-user>GUEST</mdb-user>
               <mdb-passwd>password</mdb-passwd>
               <configuration-name>RtmsResponseChannelMDB Container</configuration-name>
               <depends>application.system:service=UniqueIDGenerator</depends>
               </message-driven>
               <message-driven>
               <ejb-name>RmResponseChannelMDB</ejb-name>
               <destination-jndi-name>queue/RmResponseQueue</destination-jndi-name>
               <mdb-user>GUEST</mdb-user>
               <mdb-passwd>password</mdb-passwd>
               <configuration-name>RmResponseChannelMDB Container</configuration-name>
               <depends>application.system:service=UniqueIDGenerator</depends>
               </message-driven>
              
               <session>
               <ejb-name>cdot.ctms.layer.delegate.facade.DelegateSLSBean</ejb-name>
               <jndi-name>cdot/ctms/layer/delegate/facade/DelegateSLSBean</jndi-name>
               <local-jndi-name>DelegateSLSBeanLocal</local-jndi-name>
               <configuration-name>DelegateSLSBean Clustered Container</configuration-name>
              
               <method-attributes>
               </method-attributes>
               </session>
               <session>
               <ejb-name>DelegateAsyncSLSBean</ejb-name>
               <local-jndi-name>DelegateAsyncSLSBeanLocal</local-jndi-name>
               <configuration-name>DelegateAsyncSLSBean Container</configuration-name>
              
               <method-attributes>
               </method-attributes>
               </session>
              
               </enterprise-beans>
              
               <resource-managers>
               </resource-managers>
              
               <container-configurations>
               <!-- These are registered in the respective EJB's .java file using XDoclet -->
               <container-configuration extends="Standard Stateless SessionBean">
               <container-name>DelegateSLSBean Container</container-name>
               <security-domain>java:/jaas/CTMS-server-security-domain</security-domain>
               <instance-cache>10</instance-cache>
               </container-configuration>
               <container-configuration extends="Clustered Stateless SessionBean">
               <container-name>DelegateSLSBean Clustered Container</container-name>
               <security-domain>java:/jaas/CTMS-server-security-domain</security-domain>
               <instance-cache>10</instance-cache>
               </container-configuration>
               <container-configuration extends="Standard Stateless SessionBean">
               <container-name>DelegateAsyncSLSBean Container</container-name>
               <instance-cache>10</instance-cache>
               </container-configuration>
               <!-- Message-Driven Bean Containers. These are registred in jboss-beans.xml -->
               <container-configuration extends="Standard Message Driven Bean">
               <container-name>DelegateTopicChannelMDB Container</container-name>
               <instance-cache>10</instance-cache>
               </container-configuration>
               <container-configuration extends="Standard Message Driven Bean">
               <container-name>DelegateQueueChannelMDB Container</container-name>
               <instance-cache>10</instance-cache>
               </container-configuration>
               <container-configuration extends="Standard Message Driven Bean">
               <container-name>CommChannelMDB Container</container-name>
               <instance-cache>10</instance-cache>
               </container-configuration>
               <container-configuration extends="Standard Message Driven Bean">
               <container-name>LogChannelMDB Container</container-name>
               <instance-cache>10</instance-cache>
               </container-configuration>
               <container-configuration extends="Standard Message Driven Bean">
               <container-name>RtmsResponseChannelMDB Container</container-name>
               <instance-cache>10</instance-cache>
               </container-configuration>
               <container-configuration extends="Standard Message Driven Bean">
               <container-name>RmResponseChannelMDB Container</container-name>
               <instance-cache>10</instance-cache>
               </container-configuration>
              </container-configurations>
              
              </jboss>


              • 4. Re: client-side invoker load-balance logic in code?

                Try this:

                 <session>
                 <ejb-name>cdot.ctms.layer.delegate.facade.DelegateSLSBean</ejb-name>
                 <jndi-name>cdot/ctms/layer/delegate/facade/DelegateSLSBean</jndi-name>
                 <local-jndi-name>DelegateSLSBeanLocal</local-jndi-name>
                 <configuration-name>DelegateSLSBean Clustered Container</configuration-name>
                
                 <clustered>true</clustered>
                 <cluster-config>
                 <partition-name>DefaultPartition</partition-name>
                 <home-load-balance-policy>org.jboss.ha.framework.interfaces.RoundRobin</home-load-balance-policy>
                 <bean-load-balance-policy>org.jboss.ha.framework.interfaces.RoundRobin</bean-load-balance-policy>
                 </cluster-config>
                
                 <method-attributes>
                 </method-attributes>
                 </session>


                • 5. Re: client-side invoker load-balance logic in code?

                  first test.... worked! Thanks! I will verify and post a true confirmation. I always thought that simply extending a "clustered" container configuration from the standardjboss.xml file would ensure that my EJB was also clustered.

                  • 6. Re: client-side invoker load-balance logic in code?

                    confirmed. I will always use true ... etc., etc. from here on out and not rely on extending a particular container for clustered attributes... thanks again.