Skip to content

implements a check to do not define at runtime a value on an Map<String,String> undefined key for a BUILD_AND_RUNTIME_FIXED config #53053

@dcdh

Description

@dcdh

Description

Currently it is possible to define on a Map<String,String> config used in BUILD_AND_RUNTIME_FIXED a value on an undefined key.
When it is done on a know property a message is displayed enlightening the fact that it is not possible.

Sample reproducer:

  1. git clone https://github.com/dcdh/code-with-quarkus-config.git
  2. ./build.sh
  3. ./run.sh

You will see this message at application startup

sample-1  | 2026-03-14 21:14:25,935 WARN  [io.quarkus.runtime.configuration.ConfigRecorder] (main) Build time property cannot be changed at runtime:
sample-1  |  - config.properties.inside is set to 'redefined' but it is build time fixed to 'inside'. Did you change the property config.properties.inside after building the application?
sample-1  |  - config.property is set to 'redefined' but it is build time fixed to 'inside'. Did you change the property config.property after building the application?
sample-1  | 2026-03-14 21:14:25,935 INFO  [org.acme.MyConfigService] (main) inside
sample-1  | 2026-03-14 21:14:25,935 INFO  [org.acme.MyConfigService] (main) inside=inside
sample-1  | 2026-03-14 21:14:25,935 INFO  [org.acme.MyConfigService] (main) other=redefined

The config is defined this way

@ConfigMapping(prefix = "config")
@ConfigRoot(phase = ConfigPhase.BUILD_AND_RUN_TIME_FIXED)
public interface MyConfig {

    /**
     * property
     */
    String property();

    /**
     * properties
     */
    Map<String, String> properties();
}

The docker-compose used to launch the application is defined this way to overload the values

services:
  sample:
    image: sample/code-with-quarkus-config-sample:1.0.0-SNAPSHOT
    environment:
      - CONFIG_PROPERTY=redefined
      - CONFIG_PROPERTIES_INSIDE=redefined
      - CONFIG_PROPERTIES_OTHER=redefined

other which is an undefined key in application.properties is defined. Other are not overloaded.

Implementation ideas

It should impact the io.quarkus.runtime.configuration.ConfigRecorder

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions