Skip to content

Commit

Permalink
enhance retry
Browse files Browse the repository at this point in the history
  • Loading branch information
andifalk committed Nov 9, 2023
1 parent 6fe041e commit 596f080
Show file tree
Hide file tree
Showing 12 changed files with 13 additions and 13 deletions.
4 changes: 2 additions & 2 deletions lab1/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -314,7 +314,7 @@ public class GatewayRoutingConfiguration {
.addRequestHeader("X-MyRequestHeader", "my request"))
.uri("https://httpbin.org"))
.route("redirect-spring-io", ps -> ps.path("/spring")
.filters(f -> f.redirect(302, "https://springio.net"))
.filters(f -> f.redirect(302, "https://spring.io"))
.uri("https://example.org"))
.build();
}
Expand All @@ -326,7 +326,7 @@ This configuration is just a standard spring configuration file using the common
Here we are using the `RouteLocatorBuilder` to define routes.
Each `route()` call also contains the route _id_, the _predicate_ path, the _URI_ and _filters_.
The first route configuration entries define a call to a predefined public API endpoint at [https://httbin.org/get](https://httbin.org/get) with adding a request and a response header.
In the second route a redirect is made to the [Spring I/O Conference](https://springio.net) website.
In the second route a redirect is made to the [Spring](https://spring.io) website.

Now (re-)start the api-gateway application again. The _customer-service_ microservice is not required anymore for this step.
Next try to call the new routes at [http://localhost:9090/get](http://localhost:9090/get) and [http://localhost:9090/spring](http://localhost:9090/spring) using either the web browser or the provided postman collection (corresponding request in _Routing_ folder) and see what is happening.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ RouteLocator routing(RouteLocatorBuilder routeLocatorBuilder) {
.addRequestHeader("X-MyRequestHeader", "my request"))
.uri("https://httpbin.org"))
.route("redirect-spring-io", ps -> ps.path("/spring")
.filters(f -> f.redirect(302, "https://springio.net"))
.filters(f -> f.redirect(302, "https://spring.io"))
.uri("https://example.org"))
.build();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ RouteLocator routing(RouteLocatorBuilder routeLocatorBuilder) {
.addRequestHeader("X-MyRequestHeader", "my request"))
.uri("https://httpbin.org"))
.route("redirect-spring-io", ps -> ps.path("/spring")
.filters(f -> f.redirect(302, "https://springio.net"))
.filters(f -> f.redirect(302, "https://spring.io"))
.uri("https://example.org"))
.build();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ RouteLocator routing(RouteLocatorBuilder routeLocatorBuilder) {
.addRequestHeader("X-MyRequestHeader", "my request"))
.uri("https://httpbin.org"))
.route("redirect-spring-io", ps -> ps.path("/spring")
.filters(f -> f.redirect(302, "https://springio.net"))
.filters(f -> f.redirect(302, "https://spring.io"))
.uri("https://example.org"))
.build();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ RouteLocator routing(RouteLocatorBuilder routeLocatorBuilder) {
.addRequestHeader("X-MyRequestHeader", "my request"))
.uri("https://httpbin.org"))
.route("redirect-spring-io", ps -> ps.path("/spring")
.filters(f -> f.redirect(302, "https://springio.net"))
.filters(f -> f.redirect(302, "https://spring.io"))
.uri("https://example.org"))
.build();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ spring:
- name: Retry
args:
retries: 5
statuses: BAD_REQUEST, INTERNAL_SERVER_ERROR
statuses: REQUEST_TIMEOUT, SERVICE_UNAVAILABLE
methods: GET
backoff:
firstBackoff: 10ms
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ RouteLocator routing(RouteLocatorBuilder routeLocatorBuilder) {
.addRequestHeader("X-MyRequestHeader", "my request"))
.uri("https://httpbin.org"))
.route("redirect-spring-io", ps -> ps.path("/spring")
.filters(f -> f.redirect(302, "https://springio.net"))
.filters(f -> f.redirect(302, "https://spring.io"))
.uri("https://example.org"))
.build();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ spring:
- name: Retry
args:
retries: 5
statuses: BAD_REQUEST, INTERNAL_SERVER_ERROR
statuses: REQUEST_TIMEOUT, SERVICE_UNAVAILABLE
methods: GET
backoff:
firstBackoff: 10ms
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ RouteLocator routing(RouteLocatorBuilder routeLocatorBuilder) {
.addRequestHeader("X-MyRequestHeader", "my request"))
.uri("https://httpbin.org"))
.route("redirect-spring-io", ps -> ps.path("/spring")
.filters(f -> f.redirect(302, "https://springio.net"))
.filters(f -> f.redirect(302, "https://spring.io"))
.uri("https://example.org"))
.build();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ spring:
- name: Retry
args:
retries: 5
statuses: BAD_REQUEST, INTERNAL_SERVER_ERROR
statuses: REQUEST_TIMEOUT, SERVICE_UNAVAILABLE
methods: GET
backoff:
firstBackoff: 10ms
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ RouteLocator routing(RouteLocatorBuilder routeLocatorBuilder) {
.addRequestHeader("X-MyRequestHeader", "my request"))
.uri("https://httpbin.org"))
.route("redirect-spring-io", ps -> ps.path("/spring")
.filters(f -> f.redirect(302, "https://springio.net"))
.filters(f -> f.redirect(302, "https://spring.io"))
.uri("https://example.org"))
.build();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ spring:
- name: Retry
args:
retries: 5
statuses: BAD_REQUEST, INTERNAL_SERVER_ERROR
statuses: REQUEST_TIMEOUT, SERVICE_UNAVAILABLE
methods: GET
backoff:
firstBackoff: 10ms
Expand Down

0 comments on commit 596f080

Please sign in to comment.