diff options
Diffstat (limited to 'README.md')
-rw-r--r-- | README.md | 24 |
1 files changed, 24 insertions, 0 deletions
@@ -21,3 +21,27 @@ export DIPLONAT_CONSUL_NODE_NAME="lheureduthe" export RUST_LOG=debug cargo run ``` + +## About Consul Catalog + + * We query the `/v1/catalog/node/<node>` endpoint + * We can watch it thanks to [Blocking Queries](https://www.consul.io/api/features/blocking.html) + +eg: + +```bash +curl -vvv http://127.0.0.1:8500/v1/catalog/node/lheureduthe +# returns X-Consul-Index: 15 +curl -vvv http://127.0.0.1:8500/v1/catalog/node/lheureduthe?index=15 +``` + +Each time you do the request, the whole list of services bound to the node is returned. + + +To test the Consul Catalog part, you can do: + +```bash +consul agent -dev #in a separate terminal, if not already running +consul services register -name=example -port=1337 +consul services -id=example +``` |