This discussion is archived
8 Replies Latest reply: Dec 9, 2012 12:35 AM by 900266 RSS

How to route Stateless Bean to appropriate wls node in Cluster?

886397 Newbie
Currently Being Moderated
Hi All,

We are using WLS11G cluster for our app. There are 2 physical machine and several wls nodes in every machine together for cluster.

We deploy web module and ejb module in wls nodes.

My question is: How to route Stateless Bean to another nodes (e.g. node in the other physical server) if current node's balance is heavy?

Here is how I tested it:

1. Set the max number to 1 for the bean.
2. in the method of the bean Thread.sleep a long time.
3. mark the bean with
*<stateless-bean-is-clusterable>true</stateless-bean-is-clusterable>*
in weblogic-ejb-jar.xml, then access the web url which will invoke this EJB method (e.g. http://192.168.1.101:7001/testBean)

Then visit that URL again, now since this bean in the first ejb container is busy for the long time task, it should be routed automatically to another node (another node in the same machine or another node in the other physical machine).

But it failed, the request keeps on waiting until the first bean's task completed and been served after that.

There is no any other node that jump out to serve for the request :(

Is there any other cluster configuration needed for the stateless bean load balance?

I don't think it's related with session replication or wls Default Load Algorithm, since the stateless bean is non-state and could be routed to any of the node.

And below is the weblogic-ejb-jar.xml for this bean. Thanks.

     <weblogic-enterprise-bean>
          <ejb-name>CalculateProcessor</ejb-name>
          <stateless-session-descriptor>
               <pool>
                    <max-beans-in-free-pool>1</max-beans-in-free-pool>
               </pool>
               <stateless-clustering>
                    <stateless-bean-is-clusterable>true</stateless-bean-is-clusterable>
               </stateless-clustering>
          </stateless-session-descriptor>
     </weblogic-enterprise-bean>

Legend

  • Correct Answers - 10 points
  • Helpful Answers - 5 points