spring-cloud-tencent
spring-cloud-tencent copied to clipboard
Bugfix: InstancePreRegisteredEvent and InstanceRegisteredEvent modify Registration info
根据 Spring Cloud Commons的设计可以利用InstancePreRegisteredEvent和InstanceRegisteredEvent对Registration进行一些相关骚操作, 比如InstancePreRegisteredEvent来修改metadata
org.springframework.cloud.client.serviceregistry.AbstractAutoServiceRegistration#start()
public void start() {
if (!isEnabled()) {
if (logger.isDebugEnabled()) {
logger.debug("Discovery Lifecycle disabled. Not starting");
}
return;
}
// only initialize if nonSecurePort is greater than 0 and it isn't already running
// because of containerPortInitializer below
if (!this.running.get()) {
this.context.publishEvent(
new InstancePreRegisteredEvent(this, getRegistration()));
register();
if (shouldRegisterManagement()) {
registerManagement();
}
this.context.publishEvent(
new InstanceRegisteredEvent<>(this, getConfiguration()));
this.running.compareAndSet(false, true);
}
}
pls create issue first and like it
hello @chuntaojun , look issue 584
Use English PR title.
Codecov Report
Merging #583 (18d13ba) into main (86211c5) will decrease coverage by
0.04%. The diff coverage is33.33%.
@@ Coverage Diff @@
## main #583 +/- ##
============================================
- Coverage 76.32% 76.28% -0.05%
Complexity 982 982
============================================
Files 186 186
Lines 3510 3512 +2
Branches 419 419
============================================
Hits 2679 2679
- Misses 600 602 +2
Partials 231 231
| Impacted Files | Coverage Δ | |
|---|---|---|
| ...nt/cloud/polaris/registry/PolarisRegistration.java | 80.64% <33.33%> (-5.57%) |
:arrow_down: |
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.