我至少可以回答上面的#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.