quarkusio / quarkus

Quarkus: Supersonic Subatomic Java.
https://quarkus.io
Apache License 2.0
13.41k stars 2.57k forks source link

REST Client reporting "false negative" unrecognized URL configuration keys on startup #41577

Open wabrit opened 2 weeks ago

wabrit commented 2 weeks ago

Describe the bug

When migrating from Quarkus service from 3.5 to 3.11, some new messages appear on startup of this form:

Unrecognized configuration key "quarkus.rest-client-reactive."foo.bar.api".url" was provided; it will be ignored

One of the properties YAML read by the service contains this snippet:

foo:
  bar:
    "api/mp-rest/url": somevalue

(The api/mp-rest/url is a microprofile convention used by e.g. Spring Feign to declare endpoints for REST clients).

It appears that Quarkus REST client has some relocation / fallback rules to rewrite the mp config names to quarkus config names, and is picking up this foo.bar,"api/mp-rest/url" property and re-interpreting it as quarkus.rest-client-reactive."foo.bar.api".url.

At the least it would be good to be able to instruct Quarkus to ignore certain paths when it goes hunting for rest client URLs, as otherwise this can lead to a plethora of "false negative" unresolved property warnings amongst which could lurk some real issues. (this can occur for example when using a shared YAML that describes REST client mappings for a bunch of microservices, some of which are Spring Boot, and some of which are Quarkus).

Expected behavior

To be able to specify via configuration a list of property path prefixes to be excluded from Quarkus rest client URL discovery, thereby suppressing such "unresolved property" warnings.

Actual behavior

No such facility to exclude certain path roots is provided.

How to Reproduce?

No response

Output of uname -a or ver

MINGW64_NT-10.0-19045 LAP1453 3.3.6-341.x86_64 2022-09-05 20:28 UTC x86_64 Msys

Output of java -version

openjdk version "17.0.5" 2022-10-18 LTS OpenJDK Runtime Environment Zulu17.38+21-CA (build 17.0.5+8-LTS) OpenJDK 64-Bit Server VM Zulu17.38+21-CA (build 17.0.5+8-LTS, mixed mode, sharing)

Quarkus version or git rev

3.11.3

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

Apache Maven 3.8.6 (84538c9988a25aec085021c365c560670ad80f63)

Additional information

No response

quarkus-bot[bot] commented 2 weeks ago

/cc @cescoffier (rest-client), @geoand (rest-client), @radcortez (config)

geoand commented 2 weeks ago

I am not aware of the relocations in question, @radcortez any idea?

geoand commented 2 weeks ago

@wabrit would you be able to attach a sample application that I can use to track down what is going on?

Thanks

wabrit commented 2 weeks ago

@geoand I'll put something simple together

geoand commented 2 days ago

@wabrit where you able to put a project together that shows the problem in action?

wabrit commented 2 days ago

Apologies - I thought a minimal repro would do the trick but sadly it didn't, so then it was a question of trying to figure out what was specific in my project (e.g. native vs non-native builds) and more urgent things intervened, Will try and get back to this when I get some time.

geoand commented 2 days ago

No problem