if (!consulProperties.isEnabled())
return;
ApplicationProperties appProps = context.getBean(ApplicationProperties.class);
ServerProperties serverProperties = context.getBean(ServerProperties.class);
AgentClient agentClient = context.getBean(AgentClient.class);
Service service = new Service();
service.setName(appProps.getId());
Integer port = serverProperties.getPort();
if (port == null) {