Comments (1)
测试环境和正式环境地址不一样怎么办,
不明白您指的是什么?
如果是 FeignClientAttribute 的 Url属性的话,个人只建议在开发阶段设置,方便调试,非要使用的话可以自定义:
[AttributeUsage(AttributeTargets.Interface, Inherited = true, AllowMultiple = false)]
public class CustomFeignClientAttribute : FeignClientAttribute
{
public CustomFeignClientAttribute(string name) : base(name)
{
Url = GetUrl(name);
}
static string GetUrl(string serviceName)
{
return "xxx";
}
public override string Url { get; set; }
}
一旦 Url 设置为非null的话,服务发现就会失效了
最好的方式是实现 IServiceDiscovery 接口,可以自己读取配置文件,也可以基于Steeltoe二次开发.
from feign.net.
Related Issues (10)
- 补充文档 HOT 2
- SteeltoeServiceDiscovery 服务发现的时候没有过滤不健康节点 HOT 4
- httpclient在core 2.1以后推荐用factory 初始化 HOT 2
- IDiscoveryClient 已经迁移 HOT 1
- SteeltoeServiceDiscovery3.0.1 请教一下,还需要什么配置? HOT 5
- 怎么才能适配JsonRpc的请求 HOT 1
- 可不可以在不修改源码的情况下集成nacos HOT 2
- 降级回调方法里面能获取到异常吗?我看接口里面没有定义 HOT 6
- 看不到1.4.1版本的代码 HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from feign.net.