File tree Expand file tree Collapse file tree 3 files changed +13
-1
lines changed
cloudfoundry-client-reactor/src/main/java/org/cloudfoundry/reactor Expand file tree Collapse file tree 3 files changed +13
-1
lines changed Original file line number Diff line number Diff line change @@ -38,6 +38,11 @@ public interface ConnectionContext {
3838 */
3939 HttpClient getHttpClient ();
4040
41+ /**
42+ * The number of retries after an unsuccessful request
43+ */
44+ Long getInvalidTokenRetries ();
45+
4146 /**
4247 * The {@link ObjectMapper} to use
4348 */
Original file line number Diff line number Diff line change @@ -107,6 +107,12 @@ public HttpClient getHttpClient() {
107107 .secure (this ::configureSsl );
108108 }
109109
110+ @ Override
111+ @ Value .Default
112+ public Long getInvalidTokenRetries () {
113+ return 5L ;
114+ }
115+
110116 @ Override
111117 @ Value .Default
112118 public ObjectMapper getObjectMapper () {
Original file line number Diff line number Diff line change @@ -206,7 +206,8 @@ private Flux<HttpClientResponseWithBody> invalidateToken(Flux<HttpClientResponse
206206 private Flux <HttpClientResponseWithBody > processResponse (Flux <HttpClientResponseWithBody > inbound ) {
207207 return inbound
208208 .transform (this ::invalidateToken )
209- .retry (t -> t instanceof InvalidTokenException )
209+ .retry (this .context .getConnectionContext ().getInvalidTokenRetries (),
210+ t -> t instanceof InvalidTokenException )
210211 .transform (this .context .getErrorPayloadMapper ()
211212 .orElse (ErrorPayloadMappers .fallback ()));
212213 }
You can’t perform that action at this time.
0 commit comments