我正在使用 quarkus 1.10.5.Final 并且需要使用 Web 代理调用 Web 服务。目前我的代码使用 microprofile 客户端代理并将下面的配置放在 application.properties
client/mp-rest/url=https://remote.com
client/mp-rest/scope=javax.inject.Dependent
client/mp-rest/trustStore=classpath:/META-INF/resources/cacerts
client/mp-rest/connectTimeout=5000
client/mp-rest/readTimeout=5000
client/mp-rest/followRedirects=true
client/mp-rest/proxyAddress=http://proxy:8080
但仍然导致 RESTEASY004655: Unable to invoke request: java.net.UnknownHostException: No such host is known
我尝试使用 -Dhttp.proxyHost 和 -Dhttp.proxyPort 来测试代理,它是成功的。问题是我不能使用 -Dparams 因为它会中断其他服务调用。
这个链接我得到了 mp-rest/proxyAddress 的配置 https://download.eclipse.org/microprofile/microprofile-rest-client-2.0-RC2/microprofile-rest-client-2.0-RC2.html 但它没有在https://docs.jboss.org/resteasy/docs/4.1.1.Final/userguide/html/MicroProfile_Rest_Client.html 如果我看错了,请告诉我。