dyrnq commented on issue #8856:
URL: https://github.com/apache/apisix/issues/8856#issuecomment-1437747330

   I have some test here 
<https://github.com/dyrnq/nomad-vagrant/blob/main/scripts/test-consul-health.sh#L71>
   
   I prepare 4 instance nginx here:
   
   | ip           | port  | check                | states  |
   |--------------|-------|----------------------|---------|
   | 192.168.33.4 | 18080 | with health check    | running |
   | 192.168.33.4 | 28080 | with health check    | running |
   | 192.168.33.4 | 38080 | with health check    | Fault   |
   | 192.168.33.4 | 48080 | without health check | Fault   |
   
   
   Then I use different API to check return, give the result as follows
   
   ```
   (
   echo "fetch endpoint from catalog API"
   curl -fsSL http://127.0.0.1:8500/v1/catalog/service/nginx | jq -r '.[] | 
"\(.ServiceAddress):\(.ServicePort)"'
   echo "fetch endpoint from health API without health filter"
   curl -fsSL http://127.0.0.1:8500/v1/health/service/nginx | jq -r '.[] | 
"\(.Service.Address):\(.Service.Port)"'
   echo "fetch endpoint from health API with health filter"
   curl -fsSL http://127.0.0.1:8500/v1/health/service/nginx?passing=true | jq 
-r '.[] | "\(.Service.Address):\(.Service.Port)"'
   # https://developer.hashicorp.com/consul/api-docs/health#passing
   )
   
   
   # fetch endpoint from catalog API
   # 192.168.33.4:18080
   # 192.168.33.4:28080
   # 192.168.33.4:38080
   # 192.168.33.4:48080
   # fetch endpoint from health API without health filter
   # 192.168.33.4:18080
   # 192.168.33.4:28080
   # 192.168.33.4:38080
   # 192.168.33.4:48080
   # fetch endpoint from health API with health filter
   # 192.168.33.4:18080
   # 192.168.33.4:28080
   # 192.168.33.4:48080
   
   ```
   
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to