quarkus icon indicating copy to clipboard operation
quarkus copied to clipboard

REST client considers the wrong environment variable for `quarkus.rest-client."config-key".url`

Open derkork opened this issue 2 years ago • 4 comments

Describe the bug

I have set an environment QUARKUS_REST_CLIENT__MY_CLIENT__URL variable set which is supposed to override the quarkus.rest-client."my-client".url at runtime. The quarkus.rest-client."my-client".url has a fallback setting in application.properties.

Expected behavior

The REST client uses the URL from the environment variable. This works in Quarkus 2.11.1, but does not work in Quarkus 2.12.2.

Actual behavior

This happens in Quarkus 2.12.2:

The REST client ignores the environment variablee and uses the fallback setting in application.properties. When I change the name of the environment variable to QUARKUS_REST_CLIENT_MY_CLIENT_URL (note the missing extra underscores for the ") then the value of the environment variable is used.

In Quarkus 2.11.1, everything works as expected.

How to Reproduce?

No response

Output of uname -a or ver

Darwin 20.6.0 Darwin Kernel Version 20.6.0: Tue Feb 22 21:10:41 PST 2022; root:xnu-7195.141.26~1/RELEASE_X86_64 x86_64

Output of java -version

openjdk version "11.0.11" 2021-04-20 OpenJDK Runtime Environment AdoptOpenJDK-11.0.11+9 (build 11.0.11+9) OpenJDK 64-Bit Server VM AdoptOpenJDK-11.0.11+9 (build 11.0.11+9, mixed mode)

GraalVM version (if different from Java)

No response

Quarkus version or git rev

2.12.2

Build tool (ie. output of mvnw --version or gradlew --version)

Apache Maven 3.8.6

Additional information

No response

derkork avatar Sep 20 '22 11:09 derkork

/cc @Sgitario, @cescoffier, @geoand

quarkus-bot[bot] avatar Sep 20 '22 11:09 quarkus-bot[bot]

@radcortez what is the proper value for the env var here?

geoand avatar Sep 20 '22 11:09 geoand

It should be QUARKUS_REST_CLIENT__MY_CLIENT__URL. Let me have a look.

radcortez avatar Sep 20 '22 12:09 radcortez

The issue here is that the KeyMap for recorded default values is not handling quoted keys correctly in certain API calls. I'll fix this.

radcortez avatar Sep 21 '22 21:09 radcortez