问题描述
在TIBCO EMS用户指南(第292)说,备份服务器的将无限期地工作要么A)成为主服务器或B)重新连接到主服务器。它还说,客户端可以接收故障转移通知当切换成功(见TIBCO EMS .NET参考第220页)。我有一些问题分拆这些事实...
The TIBCO EMS user's guide (pg 292) says that 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...
- 的
- 什么样的错误,而服务器故障 - 尝试在客户端上发生过/重新连接?
- 什么是从客户端相应的反应?
- 从的ConnectionFactory获取新的Connection对象,直到一部作品?
- 等待故障切换通知? (是固定的,此时电流连接实例吗?或者我需要得到一个新的实例?)
我希望情况是清楚的,任何相关信息或意见,将太感激。
I hope the scenario is clear, any related information or advice would be appreciated too.
推荐答案
我可以。上面至少回答#1
I can at least answer #1 above.
如果您已启用Tibems.SetExceptionOnFTSwitch(真);并已成立了一个异常处理程序捕获服务器发送到客户端的消息,您会看到以下内容:
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 "
如果您尝试发布,而连接下来,TIBCO.EMS.IllegalStateException被抛出的生产者已关闭的消息。
If you attempt to publish while the connection is down, a TIBCO.EMS.IllegalStateException is thrown with the "Producer is closed" message.
以上#2,我想答案是让EMS库来处理尽可能多的。一旦我们得到了重新EMS功能工作,它优雅地尝试重新连接,直到服务器再次变得可用,一旦它重新连接,就好像从来就没有问题。唯一的疑难杂症可能是,如果你尝试之前,EMS连接返回到发布的消息。这是异常处理程序进来,一旦通知你在故障切换模式下,你可以调整异常处理在发布商方取消错误,直到连接又回来了。我不知道的事情是,你如何知道当你用尽所有重新尝试。
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.
总之,好像当它涉及到我们的两个世界息息相关EMS - 希望我们的研究结果(基于我的问题您的意见)帮助您
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.
这篇关于我应该在客户端做的,而TIBCO EMS服务器故障转移的企图?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!