-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Support Dynamic Targets #1162
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
Comments
So my suggested code illustrate: In RequestTemplate, add:
Then, the most important thing is that the target instance must not be null in RequestInterceptor.apply() method, so in SynchronousMethodHandler, add a line:
Then in my interceptor:
|
This is not really something that If you want to do dynamic host resolution, I suggest that you look into something like Ribbon or an alternative that can do that for you. Another option is to use our Request URI override support here: https://github.com/OpenFeign/feign#interface-annotations |
Our project is a very large application, need to divide a service to several cluster. e.g. CustomerService needs to be separated to CustomerService001, CustomerService002... |
I think it must be very normal appeals to access the So can
|
https://blog.csdn.net/weixin_45357522/article/details/106745468 |
Based on these comments, what you are looking for is a I'll rename this issue to reflect the need. If there is enough interest, we'll convert this into an enhancement and move forward. |
With 3.x, we can do it now. No need to change for this any more. |
I am writting a RequestInterceptor, need to know current "Target" so that I can revise the url of the RequestTemplate. While, I found the RequestTemplate.target is still null when it come into RequestInterceptor.apply method. Suggest to put the "target" value before invoke the RequestInterceptors, and provide a getter of RequestTemplate.target.
The text was updated successfully, but these errors were encountered: