Refactoring serviceId to serviceName

This commit is contained in:
Daniel Hopper
2016-01-18 10:23:52 -05:00
parent f8f2d87d0d
commit a0301fd9d0
3 changed files with 4 additions and 4 deletions

View File

@@ -89,8 +89,8 @@ public class ConsulDiscoveryProperties {
private int catalogServicesWatchTimeout = 2;
/** Unique service id */
private String serviceId;
/** Service name */
private String serviceName;
/** Unique service instance id */
private String instanceId;

View File

@@ -185,7 +185,7 @@ public class ConsulLifecycle extends AbstractDiscoveryLifecycle {
@Override
protected String getAppName() {
String appName = properties.getServiceId();
String appName = properties.getServiceName();
return StringUtils.isEmpty(appName) ? super.getAppName() : appName;
}

View File

@@ -44,7 +44,7 @@ import com.ecwid.consul.v1.agent.model.Service;
@SpringApplicationConfiguration(classes = TestPropsConfig.class)
@WebIntegrationTest(value = { "spring.application.name=myTestService",
"spring.cloud.consul.discovery.instanceId=myTestService1",
"spring.cloud.consul.discovery.serviceId=myprefix-${spring.application.name}"}, randomPort = true)
"spring.cloud.consul.discovery.serviceName=myprefix-${spring.application.name}"}, randomPort = true)
public class ConsulLifecycleCustomizedServiceNameTests {
@Autowired