Customizing Consul Service Registration
The ConsulConfiguration class features a range of customization options for altering how an instance registers with Consul. You can customize the tags, the retry attempts, the fail fast behaviour and so on.
Notice too that ConsulConfiguration
extends DiscoveryClientConfiguration which in turn extends HttpClientConfiguration allowing you to customize the settings for the Consul client, including read timeout, proxy configuration and so on.
For example:
Customizing Consul Registration Configuration
micronaut:
application:
name: hello-world
consul:
client:
registration:
enabled: true
# Alters the tags
tags:
- hello
- world
# Alters the retry count
retry-count: 5
# Alters fail fast behaviour
fail-fast: false
defaultZone: "${CONSUL_HOST:localhost}:${CONSUL_PORT:8500}"