use of com.orbitz.consul.model.agent.ImmutableRegCheck in project jim-framework by jiangmin168168.
the class ConsulRegistryService method register.
@Override
public void register(RpcURL url) {
Consul consul = this.buildConsul(url.getRegistryHost(), url.getRegistryPort());
AgentClient agent = consul.agentClient();
ImmutableRegCheck check = ImmutableRegCheck.builder().tcp(url.getHost() + ":" + url.getPort()).interval(CONSUL_HEALTH_INTERVAL).build();
ImmutableRegistration.Builder builder = ImmutableRegistration.builder();
builder.id(CONSUL_ID).name(CONSUL_NAME).addTags(CONSUL_TAGS).address(url.getHost()).port(url.getPort()).addChecks(check);
agent.register(builder.build());
}
Aggregations