英文:
Quarkus rest client: how to combine leveled rest client config in YAML config
问题
quarkus:
rest-client:
my-api:
url: ${api.url}
scope: javax.inject.Singleton
connection-pool-size: 20
mp-rest/readTimeout: 5000
mp-rest/connectTimeout: 5000
英文:
I am using Quarkus rest client and I already have congis in YAML like:
quarkus:
rest-client:
my-api:
url: ${api.url}
scope: javax.inject.Singleton
connection-pool-size: 20
Now I want to add mp-rest/readTimeout
and mp-rest/connectTimeout
as per https://stackoverflow.com/questions/63795633/how-to-configure-rest-client-in-quarkus-microprofile-case
How should I put them? Should camel case be converted to hyphen cased?
Like this?
quarkus:
rest-client:
my-api:
url: ${api.url}
scope: javax.inject.Singleton
connection-pool-size: 20
mp-rest/readTimeout: 5000
mp-rest/connectTimeout: 5000
or:
quarkus:
rest-client:
my-api:
url: ${api.url}
scope: javax.inject.Singleton
connection-pool-size: 20
mp-rest:
read-timeout: 5000
connect-timeout: 5000
BTW why YAML format is not mentioned in doc? I don't know other people but I always prefer YAML and I don't like the doc only preferring .properties
format, also I was searching in the Github repo but found no example in YAML. The conversion from properties format to YAML, in many cases, is not trivial.
For me, what is ideal is:
答案1
得分: 1
你根本不需要使用 /mp-rest
。
你可以直接使用:
quarkus:
rest-client:
my-api:
url: ${api.url}
scope: javax.inject.Singleton
connection-pool-size: 20
read-timeout: 5000
connect-timeout: 5000
更多细节请参考 此链接。
英文:
You don't need to use the /mp-rest
at all.
You can just use:
quarkus:
rest-client:
my-api:
url: ${api.url}
scope: javax.inject.Singleton
connection-pool-size: 20
read-timeout: 5000
connect-timeout: 5000
See this for more details
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论