0
votes

We have one application server running our c# windows service and one server running TIBCO EMS. Both of the servers will be restarted at different time during the week.

When the application server come back online first, we like the c# windwos service keep trying to connect to the EMS server until the EMS server is back online. ( I have got the retry logic to work for this scenario)

When the EMS server goes offiline while the application server is running(e.g. EMS client in c# is listening to incoming message on the queue), what's the best way to do the retry logic for this scenario? will an exception be thrown immediately?

Thanks

3

3 Answers

1
votes

how to get the notification of connecton close? I see there are Exception Listner and Exception Hanlder of the conneciton object. But I can not catch any of them in c# if I turn the network card off while both of them are running.

What's the differences between them?

0
votes

If your Windows Service is only meant to connect to TIBCO EMS then you could add a dependency to it. Then whenever the TIBCO EMS service is stopped/restarted, your Windows Service will respectively stop/restart. The drawback is that when you start TIBCO EMS, your Windows Service will not automaticall get started (I'm not sure if you can pair two services together to overcome this issue).

Else you can add one of the timer classes in .NET (such as System.Timers.Timer) to your class that hanldes the connection to TIBCO EMS. Then you start the timer when the connection is closed and stop it after the connection is opened. The timer can try to connect after a specified time interval.

0
votes

You should try add the properties in the below KB to your tibemsd.conf and check.

https://support.tibco.com/s/article/Tibco-KnowledgeArticle-Article-33918

For example:

client_heartbeat_server=10
client_timeout_server_connection=35
server_heartbeat_client=10
server_timeout_client_connection=35