micronaut

Micronaut

Specific best practices and architectural patterns when working with Micronaut.

Details

Language / Topic
javaJava
Category
framework

Rules

balanced

Micronaut

- Use `@Controller` with `@Get`/`@Post` annotations for HTTP endpoints. Leverage compile-time dependency injection — no reflection at runtime. Use `@Singleton` and `@Inject` for bean management.

Micronaut

- Use `@Controller` with `@Get`/`@Post` annotations for HTTP endpoints. Leverage compile-time dependency injection — no reflection at runtime. Use `@Singleton` and `@Inject` for bean management.
- Use `@Client` for declarative HTTP clients with compile-time validation. Use `@Scheduled` for cron jobs. Implement `@Error` handlers for exception mapping. Use Micronaut Data with `@Repository` for type-safe database queries. Configure with `application.yml` — use `@Value` or `@ConfigurationProperties` for typed config.