spring-cloud-gateway icon indicating copy to clipboard operation
spring-cloud-gateway copied to clipboard

Documentation for gateway actuators is patchy

Open dsyer opened this issue 1 year ago • 0 comments

Here are some issues I found when trying to use the actuators to add and update routes:

  • You can't delete (or modify) routes that were added in the app. Only the ones that you added through the endpoint. This seems like a dumb restriction but it should at least be easy to discover (e.g. by sending back a 4xx with an error message response instead of a 2xx).
  • The example output from GET /route/{id} does not match the actual output from an app
  • There is no example input for a POST, and the format is completely different (empirically) to the example referred to in docs
  • If you POST onto an existing route it gets duplicated and then causes a 500 next time you do GET /routes

What worked for me was to delete a route and then add it back (instead of trying to edit), and the format that worked was somewhere in between the example in the user docs and the actual output from the GET:

$ curl -H "Content-Type: application/json" localhost:8080/actuator/gateway/routes/app-low -d '{"predicates":["Path=/app", "Weight=app,20"],"filters":["StripPrefix=1"],"uri":"http://app:9898"}'

dsyer avatar Jan 31 '24 15:01 dsyer