You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm writing an ApplicationContextConfigurer that should add a specific environment and custom PropertySource if a given environment variable is present with a certain value.
I have 2 questions :
I want to add to the list of existing environments, not replace the whole list of environments, how can I do this ? (the builder doesn't have a "getEnvironments" method or "addEnvironment" method which would have been useful in my case)
I need the application name to be able to instanciate the propertySource, is there any way I could get it injected in my ApplicationContextConfigurer ? I have tried to use @value("micronaut.application.name") but the string is null at runtime.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
I'm writing an ApplicationContextConfigurer that should add a specific environment and custom PropertySource if a given environment variable is present with a certain value.
I have 2 questions :
I want to add to the list of existing environments, not replace the whole list of environments, how can I do this ? (the builder doesn't have a "getEnvironments" method or "addEnvironment" method which would have been useful in my case)
I need the application name to be able to instanciate the propertySource, is there any way I could get it injected in my ApplicationContextConfigurer ? I have tried to use @value("micronaut.application.name") but the string is null at runtime.
Beta Was this translation helpful? Give feedback.
All reactions