Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,13 @@ TIP: It is possible to disable Spring Cloud LoadBalancer by setting the value of

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.

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.
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fixed a typo here, too:

spring.cloud-loadbalancer.eager-load.clients

vs

spring.cloud.loadbalancer.eager-load.clients

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:

[source]
----
spring.cloud-loadbalancer.eager-load.clients[0]=my-first-client
spring.cloud-loadbalancer.eager-load.clients[1]=my-second-client
----

[[switching-between-the-load-balancing-algorithms]]
== Switching between the load-balancing algorithms
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2012-2021 the original author or authors.
* Copyright 2012-2024 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand All @@ -16,7 +16,6 @@

package org.springframework.cloud.client.loadbalancer;

import java.util.ArrayList;
import java.util.List;

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

private List<String> clients = new ArrayList<>();
private List<String> clients = List.of();

public List<String> getClients() {
return clients;
Expand Down