spring-cloud/spring-cloud-config

Let The Config Server Handle Multiple Labels Instead Of The Client

ryanjbaxter opened this issue · 0 comments

The Spring Cloud Config server can now support multiple labels (#2449). The config client no longer needs to worry about handling that on the client side.

String[] labels = new String[] { "" };
if (StringUtils.hasText(properties.getLabel())) {
labels = StringUtils.commaDelimitedListToStringArray(properties.getLabel());
}
String state = ConfigClientStateHolder.getState();
// Try all the labels until one works
for (String label : labels) {
Environment result = getRemoteEnvironment(context, resource, label.trim(), state);
if (result != null) {
log(result);