Skip to content

Commit

Permalink
RetryingClientDecorator should be outside the authentication decorato…
Browse files Browse the repository at this point in the history
…r. + Pass the builder to next chains appropriately.
  • Loading branch information
KonaEspresso94 committed Jul 21, 2024
1 parent 0d56428 commit 9189264
Showing 1 changed file with 4 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -52,11 +52,12 @@ public static NacosClientBuilder builder(URI nacosUri, String serviceName) {
@Nullable String clusterName, @Nullable Boolean healthyOnly, @Nullable String app) {
this.uri = uri;

final WebClientBuilder builder = WebClient.builder(uri)
.decorator(retryingClientDecorator);
WebClientBuilder builder = WebClient.builder(uri);
if (username != null && password != null) {
builder.decorator(LoginClient.newDecorator(builder.build(), username, password));
builder = builder.decorator(LoginClient.newDecorator(builder.build(), username, password));
}
builder = builder.decorator(retryingClientDecorator);

final WebClient webClient = builder.build();

queryInstancesClient = QueryInstancesClient.of(webClient, nacosApiVersion, serviceName, namespaceId,
Expand Down

0 comments on commit 9189264

Please sign in to comment.