Spring Cloud Gateway · Example Payload

Spring Cloud Gateway Create Route Example

Create a new gateway route dynamically at runtime

API GatewayCircuit BreakerLoad BalancingMicroservicesRate LimitingRoutingSpringSpring WebFlux

Spring Cloud Gateway Create Route Example is an example object payload from Spring Cloud Gateway, with 6 top-level fields. It illustrates the shape of data this provider's APIs accept or return.

Top-level fields

operationmethodpathdescriptionrequestresponse

Example Payload

Raw ↑
{
  "operation": "createRoute",
  "method": "POST",
  "path": "/actuator/gateway/routes",
  "description": "Create a new gateway route dynamically at runtime",
  "request": {
    "headers": {
      "Content-Type": "application/json",
      "Accept": "application/json"
    },
    "body": {
      "id": "user-service-route",
      "uri": "lb://user-service",
      "predicates": [
        {
          "name": "Path",
          "args": {
            "pattern": "/api/users/**"
          }
        },
        {
          "name": "Method",
          "args": {
            "methods": "GET,POST,PUT,DELETE"
          }
        }
      ],
      "filters": [
        {
          "name": "StripPrefix",
          "args": {
            "parts": "1"
          }
        },
        {
          "name": "AddRequestHeader",
          "args": {
            "name": "X-Gateway-Version",
            "value": "2.0"
          }
        },
        {
          "name": "RequestRateLimiter",
          "args": {
            "redis-rate-limiter.replenishRate": "100",
            "redis-rate-limiter.burstCapacity": "200",
            "key-resolver": "#{@userKeyResolver}"
          }
        }
      ],
      "order": 10
    }
  },
  "response": {
    "status": 201,
    "description": "Route created successfully"
  }
}