Java / Micronaut Interview questions
Describe how application.yml is used in Micronaut?
application.yml is Micronaut's default configuration file, read from the classpath at startup and merged with any environment-specific variants such as application-dev.yml or application-test.yml based on the active environments.
micronaut: application: name: orders-service datasources: default: url: jdbc:postgresql://localhost:5432/orders orders: retry-limit: 5
Keys map hierarchically to properties consumed via @Value or @ConfigurationProperties, and Micronaut also supports property placeholders like ${DB_URL} that resolve from environment variables, letting the same file work across local, staging, and production without code changes.
Multiple YAML files with the same key are merged, with more specific environment files taking precedence over the base file.
More Related questions...