-
Notifications
You must be signed in to change notification settings - Fork 930
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
add polaris subscribe #2100
add polaris subscribe #2100
Conversation
Codecov Report
@@ Coverage Diff @@
## 3.0 #2100 +/- ##
==========================================
- Coverage 44.74% 44.53% -0.21%
==========================================
Files 281 282 +1
Lines 16864 16941 +77
==========================================
- Hits 7546 7545 -1
- Misses 8527 8606 +79
+ Partials 791 790 -1
📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more |
@@ -67,11 +68,13 @@ func newPolarisRegistry(url *common.URL) (registry.Registry, error) { | |||
} | |||
|
|||
type polarisRegistry struct { | |||
consumer api.ConsumerAPI | |||
namespace string |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
这个 ns 信息在哪里初始化呢?
registry/polaris/registry.go
Outdated
}) | ||
} | ||
registry.NewServiceInstancesChangedEvent(serviceName, dubboInstances) | ||
listener.Next() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
你这里不吧事件传递给 listener 吗?你的把事件塞到 chan 里面去呀,不然你下面的 listener.Next 等啥呢?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
这个事件需要传递给listener吗,这个是一个notify事件,执行通知就行了
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
例如nacos
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
你先看下 nacos.subscribe 里面做的事情
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
你先看下 nacos.subscribe 里面做的事情,再看看你这里,你都没有吧 event 传到 listener 里面 chan,你这里 next 不就是死等吗
registry/polaris/listener.go
Outdated
|
||
// Next returns next service event once received | ||
func (pl *polarisListener) Next() (*registry.ServiceEvent, error) { | ||
for { | ||
select { | ||
case <-pl.closeCh: | ||
logger.Warnf("polaris listener is close!listenUrl:%+v", pl.listenUrl) | ||
logger.Warnf("polaris listener is close!listenUrl:%+v") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
这个日志打印调整下
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ok
remoting/polaris/polaris.yaml
Outdated
@@ -93,3 +82,5 @@ consumer: | |||
plugin: | |||
subscribeLocalChannel: | |||
channelBufferSize: 50 | |||
statReporter: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
放错位置了,就在原来的基础上改,不要调整 statReporter 的位置
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ok
都改了 |
What this PR does:
Which issue(s) this PR fixes:
Fixes #
You should pay attention to items below to ensure your pr passes our ci test
We do not merge pr with ci tests failed