Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Cloud/Virtualization forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Fooling Websphere's smart client stubs : invoking ejb method on all clustermembers

 
Eddi Alfare
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

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
  • corbaloc::hostNameAppServer1:nodeAgent1Port
  • corbaloc::hostNameAppServer2:nodeAgent2Port

  • (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 ?


    thanks.






     
    • Post Reply
    • Bookmark Topic Watch Topic
    • New Topic