add gateway timeout message
All checks were successful
continuous-integration/drone/push Build is passing
All checks were successful
continuous-integration/drone/push Build is passing
This commit is contained in:
parent
f7764b21d9
commit
72e722f9e5
@ -17,6 +17,7 @@ class ApiGatewayConfig {
|
|||||||
.filters { f -> f
|
.filters { f -> f
|
||||||
.hystrix { config ->
|
.hystrix { config ->
|
||||||
config.name = "input-service-sample"
|
config.name = "input-service-sample"
|
||||||
|
config.setFallbackUri("forward:/fallback")
|
||||||
}
|
}
|
||||||
.rewritePath("/api/input/v1/sample", "/sample")
|
.rewritePath("/api/input/v1/sample", "/sample")
|
||||||
}
|
}
|
||||||
@ -27,6 +28,7 @@ class ApiGatewayConfig {
|
|||||||
.filters { f -> f
|
.filters { f -> f
|
||||||
.hystrix { config ->
|
.hystrix { config ->
|
||||||
config.name = "input-service-query"
|
config.name = "input-service-query"
|
||||||
|
config.setFallbackUri("forward:/fallback")
|
||||||
}
|
}
|
||||||
.rewritePath("/api/input/v1/sample/(?<SAMPLEID>.*)", "/sample/\${SAMPLEID}")
|
.rewritePath("/api/input/v1/sample/(?<SAMPLEID>.*)", "/sample/\${SAMPLEID}")
|
||||||
}
|
}
|
||||||
@ -37,6 +39,7 @@ class ApiGatewayConfig {
|
|||||||
.filters { f -> f
|
.filters { f -> f
|
||||||
.hystrix { config ->
|
.hystrix { config ->
|
||||||
config.name = "output-service-result"
|
config.name = "output-service-result"
|
||||||
|
config.setFallbackUri("forward:/fallback")
|
||||||
}
|
}
|
||||||
.rewritePath("//api/output/v1/result", "/result")
|
.rewritePath("//api/output/v1/result", "/result")
|
||||||
}
|
}
|
||||||
@ -47,6 +50,7 @@ class ApiGatewayConfig {
|
|||||||
.filters { f -> f
|
.filters { f -> f
|
||||||
.hystrix { config ->
|
.hystrix { config ->
|
||||||
config.name = "output-service-query"
|
config.name = "output-service-query"
|
||||||
|
config.setFallbackUri("forward:/fallback")
|
||||||
}
|
}
|
||||||
.rewritePath("/api/output/v1/result/(?<RESULTID>.*)", "/result/\${RESULTID}")
|
.rewritePath("/api/output/v1/result/(?<RESULTID>.*)", "/result/\${RESULTID}")
|
||||||
}
|
}
|
||||||
@ -57,6 +61,7 @@ class ApiGatewayConfig {
|
|||||||
.filters { f -> f
|
.filters { f -> f
|
||||||
.hystrix { config ->
|
.hystrix { config ->
|
||||||
config.name = "output-service-negative"
|
config.name = "output-service-negative"
|
||||||
|
config.setFallbackUri("forward:/fallback")
|
||||||
}
|
}
|
||||||
.rewritePath("/api/output/v1/result/filter/negative", "/result/filter/negative")
|
.rewritePath("/api/output/v1/result/filter/negative", "/result/filter/negative")
|
||||||
}
|
}
|
||||||
@ -67,6 +72,7 @@ class ApiGatewayConfig {
|
|||||||
.filters { f -> f
|
.filters { f -> f
|
||||||
.hystrix { config ->
|
.hystrix { config ->
|
||||||
config.name = "output-service-positive"
|
config.name = "output-service-positive"
|
||||||
|
config.setFallbackUri("forward:/fallback")
|
||||||
}
|
}
|
||||||
.rewritePath("/api/output/v1/result/filter/positive", "/result/filter/positive")
|
.rewritePath("/api/output/v1/result/filter/positive", "/result/filter/positive")
|
||||||
}
|
}
|
||||||
@ -77,6 +83,7 @@ class ApiGatewayConfig {
|
|||||||
.filters { f -> f
|
.filters { f -> f
|
||||||
.hystrix { config ->
|
.hystrix { config ->
|
||||||
config.name = "output-service-after"
|
config.name = "output-service-after"
|
||||||
|
config.setFallbackUri("forward:/fallback")
|
||||||
}
|
}
|
||||||
.rewritePath("/api/output/v1/result/after/(?<DATEAFTER>.*)", "/result/after/\${DATEAFTER}")
|
.rewritePath("/api/output/v1/result/after/(?<DATEAFTER>.*)", "/result/after/\${DATEAFTER}")
|
||||||
}
|
}
|
||||||
@ -87,6 +94,7 @@ class ApiGatewayConfig {
|
|||||||
.filters { f -> f
|
.filters { f -> f
|
||||||
.hystrix { config ->
|
.hystrix { config ->
|
||||||
config.name = "output-service-before"
|
config.name = "output-service-before"
|
||||||
|
config.setFallbackUri("forward:/fallback")
|
||||||
}
|
}
|
||||||
.rewritePath("/api/output/v1/result/before/(?<DATEBEFORE>.*)", "/result/before/\${DATEBEFORE}")
|
.rewritePath("/api/output/v1/result/before/(?<DATEBEFORE>.*)", "/result/before/\${DATEBEFORE}")
|
||||||
}
|
}
|
||||||
|
@ -0,0 +1,15 @@
|
|||||||
|
package com.kmlabz.birbnetes.apigateway
|
||||||
|
|
||||||
|
import org.springframework.http.HttpStatus
|
||||||
|
import org.springframework.http.ResponseEntity
|
||||||
|
import org.springframework.web.bind.annotation.RequestMapping
|
||||||
|
import org.springframework.web.bind.annotation.RestController
|
||||||
|
|
||||||
|
|
||||||
|
@RestController
|
||||||
|
class ApiGatewayController {
|
||||||
|
@RequestMapping("/fallback")
|
||||||
|
fun fallback(): ResponseEntity<*>? {
|
||||||
|
return ResponseEntity<Any?>(HttpStatus.GATEWAY_TIMEOUT)
|
||||||
|
}
|
||||||
|
}
|
@ -1,13 +0,0 @@
|
|||||||
management:
|
|
||||||
endpoints:
|
|
||||||
web:
|
|
||||||
exposure:
|
|
||||||
include: hystrix.stream
|
|
||||||
|
|
||||||
hystrix:
|
|
||||||
command:
|
|
||||||
fallbackcmd:
|
|
||||||
execution:
|
|
||||||
isolation:
|
|
||||||
thread:
|
|
||||||
timeoutInMilliseconds: 3000
|
|
Loading…
Reference in New Issue
Block a user