.address(registerConfig.getString("host")) .port(registerConfig.getInt("port")) .tags(registerConfig.getStringList("tags")) .id(UUID.randomUUID().toString());
.address(registerConfig.getString("host")) .port(registerConfig.getInt("port")) .tags(registerConfig.getStringList("tags")) .id(UUID.randomUUID().toString());
computeCheck(definition) .tags(definition.getMetadata().entrySet().stream() .filter(e -> e.getValue() != null) .map(e -> e.getKey() + "=" + e.getValue())
builder.tags(tags.get());
.address(getMicroservice().getHostname()) .port(getMicroservice().getInstanceSettings().getGrpcPort()) .check(Registration.RegCheck.ttl(30L)).tags(tags).meta(Collections.singletonMap("version", getMicroservice().getVersion().getVersionIdentifier())) .build();
.address(this.myLocalAddress.getInetAddress().getHostAddress()) .port(this.myLocalAddress.getPort()) .tags(Arrays.asList(tags));
.address(this.myLocalAddress.getInetAddress().getHostAddress()) .port(this.myLocalAddress.getPort()) .tags(Arrays.asList(tags));
/** * Registers the client as a service with Consul with multiple checks * * @param port The public facing port of the service to register with Consul. * @param checks The health checks to run periodically. * @param name Service name to register. * @param id Service id to register. * @param tags Tags to register with. * @param meta Meta to register with. */ public void register(int port, List<Registration.RegCheck> checks, String name, String id, List<String> tags, Map<String, String> meta) { Registration registration = ImmutableRegistration .builder() .port(port) .checks(checks) .name(name) .id(id) .tags(tags) .meta(meta) .build(); register(registration); }
/** * Registers the client as a service with Consul with an existing {@link com.orbitz.consul.model.agent.Registration.RegCheck} * * @param port The public facing port of the service to register with Consul. * @param check The health check to run periodically. Can be null. * @param name Service name to register. * @param id Service id to register. * @param tags Tags to register with. * @param meta Meta to register with. */ public void register(int port, Registration.RegCheck check, String name, String id, List<String> tags, Map<String, String> meta) { Registration registration = ImmutableRegistration .builder() .port(port) .check(Optional.ofNullable(check)) .name(name) .id(id) .tags(tags) .meta(meta) .build(); register(registration); }