3

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

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

我有一些问题来自这些事实......

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

  2. 客户的适当回应是什么?

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

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

4

2 回答 2

4

我至少可以回答上面的#1。

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

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

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

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

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.

于 2008-10-24T20:00:16.763 回答
0

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.

于 2013-10-25T04:48:12.410 回答