Skip to content

Commit 6400b54

Browse files
authored
minor fix (#1342)
1 parent 93f11fe commit 6400b54

File tree

2 files changed

+9
-4
lines changed

2 files changed

+9
-4
lines changed

docs/modules/ROOT/pages/spring-cloud-commons/loadbalancer.adoc

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,13 @@ TIP: It is possible to disable Spring Cloud LoadBalancer by setting the value of
1414

1515
Spring Cloud LoadBalancer creates a separate Spring child context for each service id. By default, these contexts are initialised lazily, whenever the first request for a service id is being load-balanced.
1616

17-
You can choose to load those contexts eagerly. In order to do that, specify the service ids for which you want to do eager load using the `spring.cloud-loadbalancer.eager-load.clients` property.
17+
You can choose to load those contexts eagerly. In order to do that, specify the service ids for which you want to do eager load using the `spring.cloud.loadbalancer.eager-load.clients` property, for example:
18+
19+
[source]
20+
----
21+
spring.cloud-loadbalancer.eager-load.clients[0]=my-first-client
22+
spring.cloud-loadbalancer.eager-load.clients[1]=my-second-client
23+
----
1824

1925
[[switching-between-the-load-balancing-algorithms]]
2026
== Switching between the load-balancing algorithms

spring-cloud-commons/src/main/java/org/springframework/cloud/client/loadbalancer/LoadBalancerEagerLoadProperties.java

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2012-2021 the original author or authors.
2+
* Copyright 2012-2024 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -16,7 +16,6 @@
1616

1717
package org.springframework.cloud.client.loadbalancer;
1818

19-
import java.util.ArrayList;
2019
import java.util.List;
2120

2221
import org.springframework.boot.context.properties.ConfigurationProperties;
@@ -27,7 +26,7 @@
2726
@ConfigurationProperties("spring.cloud.loadbalancer.eager-load")
2827
public class LoadBalancerEagerLoadProperties {
2928

30-
private List<String> clients = new ArrayList<>();
29+
private List<String> clients = List.of();
3130

3231
public List<String> getClients() {
3332
return clients;

0 commit comments

Comments
 (0)