How to avoid 404 on Consul Config Watch for Spring Boot?

52 Views Asked by At

I'm configuring consul config on my Spring Boot app. But after release it to production I begin to get some 404's with some consul headers:

My bootstrap.yml relevant keys:

spring:
  application:
    name: myapp
  profiles:
    active: local
  main.allow-bean-definition-overriding: true
  cloud:
    config:
      enabled: false
    discovery:
      enabled: false
    consul:
      host: https://consul.mycompany.com.br
      port: 443
      config:
        enabled: true
        prefix: product-confs/myteam
        default-context: ${spring.application.name}/raw/feature-flags
        profile-separator: /

On server, the relevant key structure is:

└── raw
    ├── feature-flags
    │   ├── docker
    │   │   ├── BACKGROUND_COLOR
    │   │   └── NAVBAR
    │   ├── qa
    │   │   ├── BACKGROUND_COLOR
    │   │   └── NAVBAR
    │   └── sit
    │       ├── BACKGROUND_COLOR
    │       ├── FILTROS_VENDA_APENAS_CONJUNTO
    │       └── NAVBAR
    └── static
        ├── docker
        │   ├── config.json
        │   └── config.xml
        ├── qa
        │   ├── config.json
        │   └── config.xml
        └── sit
            ├── config.json
            └── config.xml

With this configuration the application read FILTROS_VENDA_APENAS_CONJUNTO ok, but config watch keep getting 404.

I tried change keys spring.cloud.consul.config.prefix, spring.cloud.consul.config.default-context and spring.cloud.consul.config.profile-separator, without success. Although when I disable config watch with spring.cloud.consul.config.watch.enabled: false all 404's go away.

What else can it be?

0

There are 0 best solutions below