@Override
    public void serverStarted(Server server) throws Exception {
        final Endpoint endpoint = getEndpoint(server);
        final String serviceId = serviceName + '.' + Long.toHexString(ThreadLocalRandom.current().nextLong());
        consulClient.register(serviceId, serviceName, endpoint, check, tags)
                    .aggregate()
                    .handle((res, cause) -> {
                  if (cause != null) {
                      logger.warn("Failed to register {}:{} to Consul: {}",
                                  endpoint.host(), endpoint.port(), consulClient.uri(), cause);
                      return null;
                  }

                  if (res.status() != HttpStatus.OK) {
                      logger.warn("Failed to register {}:{} to Consul: {} (status: {}, content: {})",
                                  endpoint.host(), endpoint.port(), consulClient.uri(), res.status(),
                                  res.contentUtf8());
                      return null;
                  }

                  logger.info("Registered {}:{} to Consul: {}",
                              endpoint.host(), endpoint.port(), consulClient.uri());
                  this.serviceId = serviceId;
                  return null;
              });
    }
Returns a newly-created {@link ConsulUpdatingListenerBuilder} with the specified {@code consulUri}
and {@code serviceName} to build {@link ConsulUpdatingListener}.

@param consulUri the URI of Consul API service
@param serviceName the service name which is registered into Consul.
consul/src/main/java/com/linecorp/armeria/server/consul/ConsulUpdatingListener.java