Java / Micronaut Interview questions
What are Micronaut configuration properties?
Configuration properties in Micronaut are externalized values, such as database URLs, timeouts, or feature flags, that live outside your code in files like application.yml, environment variables, or command-line arguments, and get bound into typed Java objects.
The simplest way to read a single value is @Value("${orders.retry-limit}") on a field or parameter. For a group of related settings, a class annotated with @ConfigurationProperties("orders") binds an entire configuration section to typed fields with validation support.
@ConfigurationProperties("orders") public class OrdersConfig { private int retryLimit = 3; private Duration timeout; // getters/setters }
Both approaches are resolved and validated at startup through the Environment, which merges all active property sources by precedence.
More Related questions...