I don't know how to register a service on Consul server if I got some service like "locahost:8090/user/login/username"? I'm so appreciate for your help!
Assuming that this service is already running, you can use one of the following methods to register it with Consul:
You can create a service definition json file and use the consul agent running on that host to register the service.
$ sudo mkdir /etc/consul.d
$ echo '{"service": {"name": "myService", "tags": ["java"], "port": 8080}}' \
| sudo tee /etc/consul.d/myService.json
$ consul agent -dev -config-dir=/etc/consul.d
==> Starting Consul agent...
...
[INFO] agent: Synced service 'myService'
...
More info here: https://www.consul.io/intro/getting-started/services.html
More info here: https://www.consul.io/api/agent/service.html#register-service.
Please note that you can only add the IP and the port of your service in consul and not the entire URL.
Thanks, Arul