5

有没有办法停用Weblogic 默认为特定 EJB 使用的并置对象的优化?

编辑:一些背景:

我们有一个在集群的一个节点内运行的调度程序服务。这是出于历史原因,目前无法更改。

该服务调用 EJB,我们希望对这些调用进行负载平衡。不幸的是,由于问题中提到的优化,目前每个调用都在托管调度程序服务的节点上运行。

我正在考虑编写一个自定义负载平衡类,但是这种优化似乎是在负载平衡步骤发生之前完成的。

4

4 回答 4

1

Supposing you are trying to call a remote EJB (load balancing on local ejbs can only be obtained through an indirection trick like Patrick mentioned) you will have to create a new InitialContext using the address of the cluster instead of a particular server. This new IC will provide stubs as if you were a foreign client, subject to the same load balancing strategies as they are.

Unfortunately, this means that EJB3 injections won't work. You will have to do the lookup yourself. There is a chance, an this is pure speculation, that those stubs you can get from the cluster IC are serializable. In other words, it might be possible to bind them and get them injected using @Resource afterwards.

于 2009-02-26T00:13:56.323 回答
0

不太熟悉 weblogic 的内容,但阅读他们的材料我会说你不能,没有一些诡计。

看起来您可以在不遵守并置对象优化的 EJB 前面放置一个 JMS (MDB) 外观。

或者

如果您的调度程序是基于 servlet 的,您应该能够将其部署在容器内的单独 Web 应用程序中,并让它执行对 EJB 集群的调用。

于 2008-10-21T17:07:43.613 回答
0

您的集群中有多少个节点?您是否考虑过将 EJB 部署到调度程序服务已部署到的节点以外的节点?

于 2008-10-26T09:26:21.557 回答
0

我碰巧偶然发现了这个老问题。

是否可以在调度程序和实际执行程序之间创建一个 JMS 队列?由于所有托管服务器都将从同一个队列中消费,因此队列将在某种程度上充当负载平衡器。

如果您以不同的方式解决了这个问题,我很想知道如何:)

于 2019-02-12T02:55:33.983 回答