Deactivate WebLogic load balancing optimization for hosted objects

Is there a way to deactivate optimization for hosted objects that Weblogic uses by default for a particular EJB?

EDIT: some context:

We have a scheduler service that runs inside a single node cluster. This is for historical reasons and cannot be changed at this time.

This service calls an EJB call, and we would like to load the balance of these calls. Unfortunately, at the moment, all calls are made on the node that hosts the scheduler service due to the optimization mentioned in the question.

I was thinking of coding a custom load balancing class, however this optimization seems to be done before the load balancing phase happens.

+4
source share
3 answers

Suppose you are trying to invoke a remote EJB (load balancing on local ejbs can only be obtained with the indirectness trick, as Patrick mentioned), you will have to create a new InitialContext using the cluster address instead of a specific server. This new IC will provide stubs as if you were a foreign customer, given the same load balancing strategies as they are.

Unfortunately, this means that EJB3 injections will not work. You will need to do the search yourself. There is a chance, this is a pure assumption that these stubs that you can get from the IC cluster are serializable. In other words, it would be possible to link them and get them using @Resource afterwards.

+1
source

Not too familiar with weblogic guts, but reading their material, I would say that you cannot, without any cheating.

It seems that you can place a JMS facade (MDB) in front of your EJB, which does not respect the optimization of the placed objects.

OR

If your scheduler is based on servlets, you should be able to deploy it in a separate web application in the container and make calls to the EJB cluster.

0
source

How many nodes are in your cluster? Have you considered deploying EJBs for nodes other than those on which the scheduler service was installed?

0
source

Source: https://habr.com/ru/post/1277322/


All Articles