Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Micronaut beans do not receive configuration from environments block #12082

Closed
JasonTypesCodes opened this issue Sep 13, 2021 · 0 comments · Fixed by #12809
Closed

Micronaut beans do not receive configuration from environments block #12082

JasonTypesCodes opened this issue Sep 13, 2021 · 0 comments · Fixed by #12809

Comments

@JasonTypesCodes
Copy link
Member

When using Micronaut beans within a Grails 4 / 5 application, the Micronaut beans do not receive configuration information that was provided within the environments block.

Example application: https://github.com/JasonTypesCodes/g5-mn-config

The my.message property is defined both in the base configuration as well as within environments.development

If you start the application locally with the default development environment and then retrieve http://localhost:8080/hello you will see:

<p>Grails: From Development Env</p>
<p>Micronaut: Base Config</p>

If it is intended that Micronaut beans and other Grails beans will not act the same way in this regard, it should be documented. I believe it would be best to enhance the Micronaut integration so that the same configuration properties are available to both kinds of beans so that we can more easily use Micronaut configurations within Grails applications.

@puneetbehl puneetbehl moved this from Todo to In Progress in Grails® framework 6.0 Sep 15, 2022
puneetbehl added a commit that referenced this issue Dec 6, 2022
Implemented a new MicronautYamlPropertySourceLoader which reads environment specific properties from application.yml file based on the current configured environment.

Fixes #12082
@puneetbehl puneetbehl linked a pull request Dec 6, 2022 that will close this issue
puneetbehl added a commit that referenced this issue Dec 7, 2022
* Support Environments Concept in Micronaut Context

Implemented a new MicronautYamlPropertySourceLoader which reads environment specific properties from application.yml file based on the current configured environment.

Fixes #12082

* Update GroovyConfigPropertySourceLoaderSpec.groovy
@github-project-automation github-project-automation bot moved this from In Progress to Done in Grails® framework 6.0 Dec 19, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
2 participants