网络 - java及其框架或中间件中有用到心跳机制的有哪些?
黄舟
黄舟 2017-04-18 09:46:42
0
1
446

心跳机制,一般指的就是一个检测包,检测对方或者自己是否还活着?一般心跳机制在哪些地方应用啊?具体是如何使用的?比如在zookeeper中,当服务提供方的注册地址发生改变时,它是怎么通知到服务适用房的呢?平时的话,怎么知道服务的使用方是否与zookeeper有连接呢????

黄舟
黄舟

人生最曼妙的风景,竟是内心的淡定与从容!

reply all(1)
Peter_Zhu
  1. The service provider and the service user are independent. The service provider cannot sense the existence of the service user, but coordinates service turnover through zookeeper

  2. When the service provider’s registration address changes, the service user has two options to detect this change

    1. Go to zookeeper every time to get the service provider list, which is obviously perceptible, but not efficient

    2. Use the watch primitive of zookeeperd to monitor a certain znode. Zookeeper will actively notify if there are changes
      In fact, to put it bluntly, one is pulling and the other is pushing

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!