-
-
Notifications
You must be signed in to change notification settings - Fork 367
Open
Description
Type: Bug
Component: Parameter Store
Describe the bug
When values are being loaded from Prameter Store on app startup, if the parameter name contains a digit surrounded with underscores it will not load from paramstore, instead falling back to the default value, while other parameters are injected correctly:
Sample
yaml file:
debug:
testParams:
oneNumber: ${WORD_2_WORD_WORD:placeholder}
letterNumber: ${WORD_W2_WORD_WORD:placeholder}
numberLetter: ${WORD_2W_WORD_WORD:placeholder}
singleLetter: ${WORD_W_WORD_WORD:placeholder}
config class:
package org.myapp.config;
import lombok.Getter;
import lombok.Setter;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.context.annotation.Configuration;
import java.util.Map;
@Configuration
@Getter
@Setter
@ConfigurationProperties(prefix = "debug")
public class DebugConfig {
private Map<String, String> testParams;
}
service class:
package org.myapp.service.util;
import org.myapp.config.DebugConfig;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;
@Service
@Slf4j
public class DebugService {
public DebugService(DebugConfig config) {
for (String param : config.getTestParams().keySet()) {
log.info("Value for {}: {}", param, config.getTestParams().get(param));
}
}
}
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels