Hi team,

In org.apache.servicecomb.serviceregistry.task.MicroserviceRegisterTask#doRegister,
 the instanceId is set to "null" when re-registering microservice. 


Here is a issue [SCB-1489] Microservice instance wouldn't work after we 
shotdown our service center for updating while we had enabled RSA 
authentication between services (issues.apache.org/jira/browse/SCB-1489) seems 
to related to resetting instanceId.


As Haishi Yao comment in SCB-1489: If the service reset the instanceId but not 
reset the token, provider will get old consumer instanceId parsed by token 
while the actual instanceId is already updated. I think the problem will 
be solved if application keep the instanceId immutable after application 
starting.


Although the issue can alse be solved by resetting token everytime resetting 
instanceId, I think use old instanceId to re-registering service is easier to 
understand and more efficient although there are some reasons to reset the 
instanceId. BTW, I have checked the code in service center and find the 
instanceId is generated as UUID.


Anyone have ideas about why resetting the instanceId when re-registering 
service? I have no idea till now.


Ang Li

Reply via email to