Register service do not return the id when value of 0.
This commit is contained in:
parent
ae1b0e3c85
commit
8abad65f6b
|
|
@ -29,8 +29,10 @@ public class ApplicationRegisterServiceHandler extends ApplicationRegisterServic
|
|||
String applicationCode = applicationCodes.get(i);
|
||||
int applicationId = applicationIDService.getOrCreate(applicationCode);
|
||||
|
||||
KeyWithIntegerValue value = KeyWithIntegerValue.newBuilder().setKey(applicationCode).setValue(applicationId).build();
|
||||
builder.addApplication(i, value);
|
||||
if (applicationId != 0) {
|
||||
KeyWithIntegerValue value = KeyWithIntegerValue.newBuilder().setKey(applicationCode).setValue(applicationId).build();
|
||||
builder.addApplication(value);
|
||||
}
|
||||
}
|
||||
responseObserver.onNext(builder.build());
|
||||
responseObserver.onCompleted();
|
||||
|
|
|
|||
|
|
@ -30,10 +30,13 @@ public class ServiceNameDiscoveryServiceHandler extends ServiceNameDiscoveryServ
|
|||
int applicationId = serviceNameElement.getApplicationId();
|
||||
String serviceName = serviceNameElement.getServiceName();
|
||||
int serviceId = serviceNameService.getOrCreate(applicationId, serviceName);
|
||||
ServiceNameMappingElement.Builder mappingElement = ServiceNameMappingElement.newBuilder();
|
||||
mappingElement.setServiceId(serviceId);
|
||||
mappingElement.setElement(serviceNameElement);
|
||||
builder.addElements(mappingElement);
|
||||
|
||||
if (serviceId != 0) {
|
||||
ServiceNameMappingElement.Builder mappingElement = ServiceNameMappingElement.newBuilder();
|
||||
mappingElement.setServiceId(serviceId);
|
||||
mappingElement.setElement(serviceNameElement);
|
||||
builder.addElements(mappingElement);
|
||||
}
|
||||
}
|
||||
|
||||
responseObserver.onNext(builder.build());
|
||||
|
|
|
|||
Loading…
Reference in New Issue