Closed GuangmingLuo closed 5 years ago
+1
Hi,
Thanks for reaching us.
After you set client.url
property in your application's properties file it will be translated to baseUrl
property in generated client. It needs to be http url but it doesn't require port.
Isn't that enough to support service discovery?
If not, how does your url looks like and how would you like to be the method's body of generated client?
What about SpringFeignClientInterfaceRule
?
Hi, Great !Thanks for your reply.
I have tried to set base-url= http://{my_service_name}, it works!!! I didn't know that port is not a must requirement.
In this case, as long as you have registered your target server to Consul or Eureka, you may simply set base-url like this: base-url= http://{my_service_name} . And add @LoadBalance to RestTemplate initialization. Service discovery works.
Cool.
Have you tried to generate feign client (SpringFeignClientInterfaceRule
)?
Can we close this issue?
Hi, I haven't tried yet. Can you show an example to use this rule ? And which version should be used ?
And yes, you may close this issue.
I've just discovered 2 issues with FegnClient generation. I'm addressing them in #284. Hopefully, it will be done soon and I will provide an example.
Hi,
Within the client-side code generated by this plugin, user has to specify the baseUrl and this baseUrl must be IP+PORT, because there is "builder.build". In this case, we can't set this baseUrl to a application name, which can be used by service discovery. RestTemplate used in the code is perfect for service discovery. Why doesn't the code support that ? Can this feature be added ?
I am looking forward to your reply. Thanks.
BR