diff --git a/kilimo-gateway-localhost.yml b/kilimo-gateway-localhost.yml index 33dae96..b9af21c 100644 --- a/kilimo-gateway-localhost.yml +++ b/kilimo-gateway-localhost.yml @@ -1,36 +1,67 @@ server: port: 9080 + spring: application: name: kilimo-gateway + + # 1. Config Server Import (2026 Recommended Syntax) + config: + import: "optional:configserver:https://admin:password@config.qruvw.xyz" + + # 2. Redis Configuration data: redis: host: localhost port: 6379 + connect-timeout: 2000ms + + # 3. Gateway Routing (Modern WebFlux Namespace) cloud: gateway: - routes: - - id: kilimo_core_service - uri: http://localhost:9081 - predicates: - - Path=/core/** - filters: - - RewritePath=/core/(?.*), /$\{segment} - - name: AuthFilter - - name: RequestRateLimiter - args: - redis-rate-limiter.replenishRate: 10 - redis-rate-limiter.burstCapacity: 20 - key-resolver: "#{@userKeyResolver}" - - id: kilimo_assistant_service - uri: http://localhost:9082 - predicates: - - Path=/assistant/** - filters: - - RewritePath=/assistant/(?.*), /$\{segment} - - name: AuthFilter - - name: RequestRateLimiter - args: - redis-rate-limiter.replenishRate: 10 - redis-rate-limiter.burstCapacity: 20 - key-resolver: "#{@userKeyResolver}" \ No newline at end of file + server: + webflux: # CRITICAL: Modern properties live under this node + routes: + # --- Core Service Route --- + - id: kilimo_core_service + uri: http://localhost:9081 + predicates: + - Path=/core/** + filters: + - RewritePath=/core/(?.*), /$\{segment} + - name: AuthFilter + - name: RequestRateLimiter + args: + redis-rate-limiter.replenishRate: 10 + redis-rate-limiter.burstCapacity: 20 + key-resolver: "#{@userKeyResolver}" + + # --- Assistant Service Route --- + - id: kilimo_assistant_service + uri: http://localhost:9082 + predicates: + - Path=/assistant/** + filters: + - RewritePath=/assistant/(?.*), /$\{segment} + - name: AuthFilter + - name: RequestRateLimiter + args: + redis-rate-limiter.replenishRate: 10 + redis-rate-limiter.burstCapacity: 20 + key-resolver: "#{@userKeyResolver}" + +# 4. Actuator for Troubleshooting +management: + endpoints: + web: + exposure: + include: gateway, health, info + endpoint: + gateway: + enabled: true + +# 5. Debugging Logging (Helpful to fix the 404) +logging: + level: + org.springframework.cloud.gateway: TRACE + org.springframework.http.server.reactive: DEBUG \ No newline at end of file diff --git a/kilimo-gateway-production.yml b/kilimo-gateway-production.yml index 33dae96..b9af21c 100644 --- a/kilimo-gateway-production.yml +++ b/kilimo-gateway-production.yml @@ -1,36 +1,67 @@ server: port: 9080 + spring: application: name: kilimo-gateway + + # 1. Config Server Import (2026 Recommended Syntax) + config: + import: "optional:configserver:https://admin:password@config.qruvw.xyz" + + # 2. Redis Configuration data: redis: host: localhost port: 6379 + connect-timeout: 2000ms + + # 3. Gateway Routing (Modern WebFlux Namespace) cloud: gateway: - routes: - - id: kilimo_core_service - uri: http://localhost:9081 - predicates: - - Path=/core/** - filters: - - RewritePath=/core/(?.*), /$\{segment} - - name: AuthFilter - - name: RequestRateLimiter - args: - redis-rate-limiter.replenishRate: 10 - redis-rate-limiter.burstCapacity: 20 - key-resolver: "#{@userKeyResolver}" - - id: kilimo_assistant_service - uri: http://localhost:9082 - predicates: - - Path=/assistant/** - filters: - - RewritePath=/assistant/(?.*), /$\{segment} - - name: AuthFilter - - name: RequestRateLimiter - args: - redis-rate-limiter.replenishRate: 10 - redis-rate-limiter.burstCapacity: 20 - key-resolver: "#{@userKeyResolver}" \ No newline at end of file + server: + webflux: # CRITICAL: Modern properties live under this node + routes: + # --- Core Service Route --- + - id: kilimo_core_service + uri: http://localhost:9081 + predicates: + - Path=/core/** + filters: + - RewritePath=/core/(?.*), /$\{segment} + - name: AuthFilter + - name: RequestRateLimiter + args: + redis-rate-limiter.replenishRate: 10 + redis-rate-limiter.burstCapacity: 20 + key-resolver: "#{@userKeyResolver}" + + # --- Assistant Service Route --- + - id: kilimo_assistant_service + uri: http://localhost:9082 + predicates: + - Path=/assistant/** + filters: + - RewritePath=/assistant/(?.*), /$\{segment} + - name: AuthFilter + - name: RequestRateLimiter + args: + redis-rate-limiter.replenishRate: 10 + redis-rate-limiter.burstCapacity: 20 + key-resolver: "#{@userKeyResolver}" + +# 4. Actuator for Troubleshooting +management: + endpoints: + web: + exposure: + include: gateway, health, info + endpoint: + gateway: + enabled: true + +# 5. Debugging Logging (Helpful to fix the 404) +logging: + level: + org.springframework.cloud.gateway: TRACE + org.springframework.http.server.reactive: DEBUG \ No newline at end of file