当 TIBCO EMS 服务器尝试故障转移时,客户端应该做什么?

发布于 2024-07-08 21:38:28 字数 525 浏览 6 评论 0原文

TIBCO EMS 用户指南(第 292 页)说道:

备份服务器将无限期地工作,以便 A) 成为 主服务器或 B) 重新连接到主服务器。 它还说 当切换成功时,客户端可能会收到故障转移通知(另请参阅 TIBCO EMS .NET 参考第 220 页)。

我对这些事实有一些疑问...

  1. 当服务器尝试故障转移/重新连接时,客户端会发生什么样的错误?

    当服务器尝试故障转移/重新连接
  2. 客户的适当回应是什么?

    • 从 ConnectionFactory 获取新的 Connection 对象,直至其正常工作?
    • 等待故障转移通知? (当前的 Connection 实例此时已修复吗?还是我需要获取一个新实例?)

我希望场景很清楚,任何相关信息或建议也将不胜感激。

The TIBCO EMS user's guide (pg 292) says:

The backup server will work indefinitely to either A) become the
primary server or B) reconnect to the primary server. It also says
clients may receive fail-over notification when the switch is successful (see also TIBCO EMS .NET reference pg 220).

I have some questions spinning off of these facts...

  1. What kind of errors occur on the client side while the servers are attempting fail-over/reconnect?

  2. What is the appropriate response from the client?

    • Get new Connection objects from the ConnectionFactory until one works?
    • Wait for fail-over notification? (are current Connection instances fixed at this time? or do I need to get a new instance?)

I hope the scenario is clear, any related information or advice would be appreciated too.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

む无字情书 2024-07-15 21:38:28

我至少可以回答上面的第一个问题。

如果您已启用 Tibems.SetExceptionOnFTSwitch(true); 并且设置了异常处理程序来捕获服务器发送到客户端的消息,您将看到以下内容:

对于单服务器、非容错连接失败:
“连接已终止”。

对于容错连接失败:
“连接已执行容错切换到”

如果在连接关闭时尝试发布,则会引发 TIBCO.EMS.IllegalStateException 并显示“生产者已关闭”消息。

对于上面的#2,我认为答案是让 EMS 库处理尽可能多的内容。 一旦我们让 EMS 重新连接功能发挥作用,它就会优雅地尝试重新连接,直到服务器再次可用,一旦重新连接,就好像从来没有出现过问题一样。 唯一的问题可能是您尝试在 ems 连接恢复之前发布消息。 这就是异常处理程序的用武之地,一旦通知您处于故障转移模式,您可以调整发布者端的异常处理以抑制错误,直到连接恢复。 我不知道的是当你用尽所有重新连接尝试时如何判断。

不管怎样,就 EMS 而言,似乎我们的两个世界密切相关 - 希望我们的发现(基于您对我的问题的评论)对您有所帮助。

I can at least answer #1 above.

If you have enabled Tibems.SetExceptionOnFTSwitch(true); and have set up an exception handler to capture the messages the server sends to the client, you will see the following:

For single-server, non-fault tolerant connection failures:
"Connection has been terminated".

For fault-tolerant connection failures:
"Connection has performed fault-tolerant switch to "

If you attempt to publish while the connection is down, a TIBCO.EMS.IllegalStateException is thrown with the "Producer is closed" message.

for #2 above, I think the answer is to allow the EMS library to handle as much as possible. Once we got the EMS reconnect functionality to work, it gracefully tried to reconnect until the server became available again and once it reconnected, it was like there was never a problem. The only gotcha is probably if you try to publish a message before the ems connection is back. This is where the exception handler comes in, Once notified that you are in failover mode, you can adjust exception handling on the publisher side to suppress the error until the connection is back. The thing I don't know is how do you tell when you've exhausted all reconnect attempts.

Anyway, Seems like our two worlds are closely related when it comes to EMS - hope our findings (based on your comments on my questions) help you.

南街女流氓 2024-07-15 21:38:28

我们使用 TEMS(Tibco EMS - 用于 WCF 的 Tibco 产品),因此它成为自定义绑定。 我们尝试通过诸如弹跳服务器来强制切换之类的方法来打破它,效果非常好。 确保您使用的是 1.2 版而不是 1.1 版,因为除了客户确认之外您无法执行任何操作。

We use TEMS (Tibco EMS - a Tibco Product for WCF) So it becomes a custom binding. We tried to break it by doing things like bounce the server to force switch overs and it works really well. make sure you are using version 1.2 not 1.1 because you cannot do anything other then client acknowledgement.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文