Java / Micronaut Interview questions
What is Micronaut's service discovery mechanism?
Service discovery in Micronaut lets services find each other by logical name instead of hardcoded addresses, and it's pluggable rather than tied to one product.
Out of the box, Micronaut supports Consul and Eureka as discovery servers, plus native discovery for Kubernetes (using the Kubernetes API or DNS) and AWS (Route 53, ECS, CloudMap). A service registers itself on startup by adding the relevant dependency and configuration, and other services locate it either through a @Client("service-name") reference or by injecting a DiscoveryClient directly for programmatic lookups.
consul: client: registration: enabled: true defaultZone: "localhost:8500"
This decouples service location from configuration files, which is essential in environments where instances are created and destroyed dynamically, such as autoscaling groups or Kubernetes pods.
More Related questions...