1

I have been working on the SOA POC since last few days. For service discovery & registry, we are considering Consul. Once we have registered the services in consul, how we should keep track of running status of the registered services? We are implementing things on .net platform where some wcf services are hosted on the different appdomains, some in separate console process. We can keep track of the services in two ways.

  1. Listening the ports using socket connection with heartbeats .
  2. Handling the appdomain unload & console exit events.

A. Is there any other way to handle this scenario?

B. How we can get notification when console application process gets terminated ? procss might be killed,closed etc. How we can gracefully remove the service registry entry from Consul central repository?

C. Listening all the ports with certain heartbeat is efficient way as it will keep threads busy all the times?

Any help is most appreciated?

4

1 回答 1

1
  • A. 您可以使用此处定义的任何检查来监控服务的运行状况
  • B. 要优雅地从 consul 中删除服务,您可以对本地 consul 代理执行此 http 调用。我建议将此添加到您的服务的关闭逻辑中。如果您希望 consul 在您的服务中断时给您某种警告,您可以使用Watches

  • C. 健康检查按设定的时间间隔执行。所以你决定检查的强度。例如:每 30 秒

于 2015-12-03T13:57:33.530 回答