log retry context
This commit is contained in:
@@ -45,7 +45,12 @@ public class ConfigClientRetryBootstrapper implements BootstrapRegistryInitializ
|
||||
RetryProperties properties = resource.getRetryProperties();
|
||||
RetryTemplate retryTemplate = RetryTemplateFactory.create(properties, resource.getLog());
|
||||
return retryTemplate.execute(
|
||||
retryContext -> loadContext.getInvocation().apply(loadContext.getLoaderContext(), resource));
|
||||
retryContext -> {
|
||||
if (resource.getLog().isDebugEnabled()) {
|
||||
resource.getLog().debug("Retry: count=" + retryContext.getRetryCount());
|
||||
}
|
||||
return loadContext.getInvocation().apply(loadContext.getLoaderContext(), resource);
|
||||
});
|
||||
}
|
||||
return loadContext.getInvocation().apply(loadContext.getLoaderContext(), resource);
|
||||
});
|
||||
|
||||
@@ -45,6 +45,8 @@ public class ApplicationFailFastTests {
|
||||
"--spring.cloud.config.enabled=true", "--spring.cloud.config.fail-fast=true",
|
||||
"--spring.config.import=optional:configserver:http://serverhostdoesnotexist:1234",
|
||||
"--spring.cloud.config.server.enabled=false",
|
||||
"--logging.level.org.springframework.retry=TRACE",
|
||||
"--logging.level.org.springframework.cloud.config=TRACE",
|
||||
"--logging.level.org.springframework.boot.context.config=TRACE");
|
||||
}).as("Exception not caused by fail fast").hasMessageContaining("fail fast");
|
||||
assertThat(output).contains("Retry: count=5");
|
||||
|
||||
Reference in New Issue
Block a user