wood burning stoves 2.0*
The moose likes EJB and other Java EE Technologies and the fly likes How to route Stateless Bean to appropriate node in weblogic Cluster? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


JavaRanch » Java Forums » Java » EJB and other Java EE Technologies
Bookmark "How to route Stateless Bean to appropriate node in weblogic Cluster?" Watch "How to route Stateless Bean to appropriate node in weblogic Cluster?" New topic
Author

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

Jeffty Stone
Greenhorn

Joined: Nov 14, 2011
Posts: 2
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 clusterable as below in weblogic-ejb-jar.xml, then access the web url which will invoke this EJB method (e.g. http://19x.xx.xx.xx:7001/testBean)
<stateless-bean-is-clusterable>true</stateless-bean-is-clusterable>
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 weblogic 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>
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: How to route Stateless Bean to appropriate node in weblogic Cluster?