Skip to content
This repository has been archived by the owner on Jan 4, 2025. It is now read-only.

Latest commit

 

History

History
55 lines (44 loc) · 3.32 KB

README.md

File metadata and controls

55 lines (44 loc) · 3.32 KB

Build GitHub Release Release date
Quality Gate Status Bugs Code Smells Coverage Reliability Rating Security Rating Vulnerabilities

Micronaut Consul Watcher

The watcher calls the KV Store API to watch all keys used for the distributed configurations, using Blocking Queries to wait for any changes made on those keys.
If no change occurred during the max-wait-duration, the query will be re-executed after the delay-duration.
When a change is detected in a KV used for configurations, the corresponding PropertySource will be updated and a RefreshEvent published.

See Micronaut > Refreshable Scope for more details

Configuration

The watcher can be configured using

micronaut:
  application:
    name: hello-world
  config-client:
    enabled: true

consul:
  client:
    defaultZone: "${CONSUL_HOST:localhost}:${CONSUL_PORT:8500}"
    config:
      format: YAML
      path: /config

  watch:
    disabled: false # to disable the watcher, during test for instance
    max-wait-duration: 10m # Sets the maximum duration for the blocking request
    delay-duration: 50ms # Sets the watch delay before each call to avoid flooding

Formats supported are

  • NATIVE
  • JSON
  • PROPERTIES
  • YAML

Read Micronaut > Distributed Configuration > HashiCorp Consul Support for more details.