Fooling Websphere's smart client stubs : invoking ejb method on all clustermembers
Joined: Jan 10, 2010
I am using Websphere 6.0 and ejb 2.0 and a WebStart client.
I have 2 appservers running in one cluster on different nodes.
What I want to achieve, is to have a particular ejb method to be invoked on both appservers.
(Normally, because of the WorkLoad Management facility in Websphere, any remote ejb-call will result into only one of the appservers executing this method.)
This is what I tried to 'bypass' this WLM for this particular ejb-method call :
On the client I perform two lookups of the ejb, each time with a different InitialContext to connect to each specific appserver.
My code to create the InitialContext is as follows:
The values for providerUrl are
(nodeAgentXPort is the bootstrap port of the nodeagent on which appServerX is running.)
I then look up the ejb ref on each InitialContext and invoke the ejb method on each ejb ref.
When I run this code, most of the times both method calls are directed to the same appserver.
It seems like Websphere's "smart client stubs" cannot be fooled and still load balance whether I like it or not.
Any ideas on how I could bypass the workload manager for this particular ejb ?