-
Notifications
You must be signed in to change notification settings - Fork 72
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Base URL not dynamic #213
Comments
Do you mean you want this functionality with injecting a CDI Bean of the interface, as it's already possible to do this with the programmatic API? |
Basically I would like to have an |
Correct. RESTEasy builder sets the URL fairly early on which wouldn’t allow for reuse of the instance
…Sent from my iPhone
On Sep 18, 2019, at 09:39, Michel Erard ***@***.***> wrote:
Basically I would like to have an ApplicationScoped client that reacts on changes in the mp-config (at least for the URL), what is possible via the different mp-config extensions. Programmatically I can create a client with every request and use the current configured url then the client is RequestScoped
But digging more in the code this is probably not feasible. At least with RestEasy a new WebTarget and consequently a new proxy is needed.
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub, or mute the thread.
|
+1 The URL (including protocol and port) should be easily changeable at runtime for the reasons already mentioned. We also do health monitoring on endpoints and need to switch URLs at runtime accordingly. |
Would be great to have this feature implemented. Right now using microprofile rest client for requests with different URLs is not quite possible. I receive a callback URL inside each request, create rest client every time for each callback url is not an option |
I have the same use case. One more thing, HTTP clients are heavy objects, and creating one on each request causes overhead |
With the current specification the
baseURL
is static and cannot be changed during runtime. For simple scenarios or systems running on kubernetes this might be fine. But imagine a system using Consul for service discovery, there we might change the base url on the fly during runtime depending on the health of the endpoints. And depending on the underlying implementation changing the target should be possible without performance impact. Even the client isApplicationScoped
. The client should set the target with every request or check if thebaseURL
has changed. The change in mp-config could be done by an extension and must not be seen as static.The text was updated successfully, but these errors were encountered: