.name(registerConfig.getString("name")) .address(registerConfig.getString("host")) .port(registerConfig.getInt("port"))
.name(registerConfig.getString("name")) .address(registerConfig.getString("host")) .port(registerConfig.getInt("port"))
.address(computeServiceHost(definition)) .port(definition.getPort()) .name(definition.getName()) .id(definition.getId()) .check(
builder.name(serviceName);
tags.add(getMicroservice().getIdentifier().getShortName()); Registration service = ImmutableRegistration.builder().id(getMicroservice().getId().toString()) .name(getMicroservice().getIdentifier().getShortName()) .address(getMicroservice().getHostname()) .port(getMicroservice().getInstanceSettings().getGrpcPort())
ImmutableRegistration.Builder builder = ImmutableRegistration.builder(); if (json.name != null) { builder.name(json.name);
name(instance.getName()); id(instance.getId()); Optional<String> addressOptional = instance.getAddress();
.name(this.consulServiceName) .id(myServiceId) .address(this.myLocalAddress.getInetAddress().getHostAddress())
.name(this.consulServiceName) .id(myServiceId) .address(this.myLocalAddress.getInetAddress().getHostAddress())
/** * 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); }
public void advertise(Registration registration) { if (this.advertisements.contains(registration)) { return; } AgentClient client = this.agentClientInjector.getValue(); com.orbitz.consul.model.agent.Registration consulReg = ImmutableRegistration.builder() .address(registration.getAddress()) .port(registration.getPort()) .id(serviceId(registration)) .name(registration.getName()) .addTags(registration.getTags().toArray(new String[]{})) .check(com.orbitz.consul.model.agent.Registration.RegCheck.ttl(3L)) .build(); client.register(consulReg); this.advertisements.add(registration); }
public void register(String name, int port) { log.info("Will register " + name + " with port " + port); AgentClient agentClient = client.agentClient(); Registration service = ImmutableRegistration.builder().id(name).name(name).port(port) .check(Registration.RegCheck.http("http://localhost:" + port + Constants.HEALTH_CONTEXT, 60, 5)).build(); agentClient.register(service); }