/** * Registers the client as a service with Consul. Registration enables * the use of checks. * * @param host The public facing host of the service to register with Consul. * @param port The public facing port of the service to register with Consul. * @param ttl Time to live for the Consul dead man's switch. * @param serviceName Service name to register. * @param serviceId Service id to register. * @param tags Tags to register with. */ public void registerService(final String host, final int port, final long ttl, final String serviceName, final String serviceId, final String... tags) { RegistrationCheck check = new RegistrationCheck(); check.setTtl("" + ttl + "s"); registerServiceWithRegistrationCheck(host, port, check, serviceName, serviceId, tags); }
/** * Registers the client as a service with Consul. * Registration enables * the use of check with a script. * * @param host The public facing host of the service to register with Consul. * @param port The public facing port of the service to register with Consul. * @param script Health script for Consul to use. * @param interval Health script run interval in seconds. * @param serviceName Service name to register. * @param serviceId Service id to register. * @param tags Tags to register with. */ public void registerServiceWithScript(final String host, final int port, final String script, final long interval, final String serviceName, final String serviceId, final String... tags) { RegistrationCheck check = new RegistrationCheck(); check.setScript(script); check.setInterval("" + interval + "s"); registerServiceWithRegistrationCheck(host, port, check, serviceName, serviceId, tags); }
/** * Registers the client as a service with Consul. Registration enables * the use of checks. * * @param port The public facing port of the service to register with Consul. * @param ttl Time to live for the Consul dead man's switch. * @param serviceName Service name to register. * @param serviceId Service id to register. * @param tags Tags to register with. */ public void registerService(final int port, final long ttl, final String serviceName, final String serviceId, final String... tags) { RegistrationCheck check = new RegistrationCheck(); check.setTtl("" + ttl + "s"); registerServiceWithRegistrationCheck(port, check, serviceName, serviceId, tags); }
/** * Registers the client as a service with Consul. * Registration enables * the use of check with a script. * * @param port The public facing port of the service to register with Consul. * @param script Health script for Consul to use. * @param interval Health script run interval in seconds. * @param serviceName Service name to register. * @param serviceId Service id to register. * @param tags Tags to register with. */ public void registerServiceWithScript(final int port, final String script, final long interval, final String serviceName, final String serviceId, final String... tags) { RegistrationCheck check = new RegistrationCheck(); check.setScript(script); check.setInterval("" + interval + "s"); registerServiceWithRegistrationCheck(port, check, serviceName, serviceId, tags); }