-
Hi all, With this class we are able to get configuration from an You can see we are mapping The problem I am facing is that the environment where this application runs sets some env vars (used for a different purpose) starting with ERROR: Failed to start application (with profile [prod])
java.util.NoSuchElementException: SRCFG00040: The config property kafka.bridge.producer.config is defined as the empty String ("") which the following Converter considered to be null: io.smallrye.config.Converters$BuiltInConverter So my question is ... is there any way to avoid some prefixed env vars to be mapped (i.e. all starting with @Override
public ConfigValue getValue(ConfigSourceInterceptorContext context, String name) {
...
...
if (name.startsWith("kafka.bridge.")) {
return null;
}
} I also tried a really BAD hack by adding trash "bucket" (actually a Map) into the |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 5 replies
-
Currently, there is no way to do it. When mapping properties, the Config system doesn't care from where the config property is coming from. I've suggested the interceptor and remove the properties. Still, unfortunately, that doesn't work because we always apply another interceptor on top (no matter the priority), to convert environment variables to their dotted format. The bucket solution should work, but remember to quote the Map<String, @WithConverter(IgnoreConverter.class) String> bridge();
class IgnoreConverter implements Converter<String> {
@Override
public String convert(final String s) throws IllegalArgumentException, NullPointerException {
return "ignored";
}
} |
Beta Was this translation helpful? Give feedback.
Currently, there is no way to do it.
When mapping properties, the Config system doesn't care from where the config property is coming from.
I've suggested the interceptor and remove the properties. Still, unfortunately, that doesn't work because we always apply another interceptor on top (no matter the priority), to convert environment variables to their dotted format.
The bucket solution should work, but remember to quote the
kafka.bridge
in the interceptor. Also, you need to add a converter to handle empty values, because we always expect to have a value so you can do something like: