Skip to content

服务注册发现中的watch机制如何与kitex 进行更好的对接? #330

Closed Answered by YangruiEmma
liu-song asked this question in Q&A
Discussion options

You must be logged in to vote

@liu-song 抱歉,没有注意到你发起的disussion。watch需要保持长连接,每个服务实例都与和注册中心保持长连接感知变更并不是一个建议的实践方式,在微服务规模变大后该方式并不可取,除非是通过proxy获取服务实例可以采用watch方式,否则建议的方式是短连接请求注册中心获取实例(触发请求由Kitex缓存策略决定)。

update: 也可以通过在 resolver 里实现一个 push -> pull 的 adaptor 来接入 kitex,详见后面的伪代码示例。

Replies: 7 comments 16 replies

Comment options

You must be logged in to vote
0 replies
Answer selected by liu-song
Comment options

You must be logged in to vote
3 replies
@li-jin-gou
Comment options

@someview
Comment options

@li-jin-gou
Comment options

Comment options

You must be logged in to vote
3 replies
@li-jin-gou
Comment options

@li-jin-gou
Comment options

@someview
Comment options

Comment options

You must be logged in to vote
1 reply
@li-jin-gou
Comment options

Comment options

You must be logged in to vote
3 replies
@li-jin-gou
Comment options

@someview
Comment options

@GuangmingLuo
Comment options

Comment options

You must be logged in to vote
4 replies
@li-jin-gou
Comment options

@someview
Comment options

@li-jin-gou
Comment options

@li-jin-gou
Comment options

Comment options

You must be logged in to vote
2 replies
@someview
Comment options

@felix021
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
6 participants