标签:oca war service ddd http desc pad get url
首先先安装nuget组件:Steeltoe.Discovery.ClientCore
然后在ConfigureServices中进行注入
services.AddDiscoveryClient(Configuration);
Configure中引用
app.UseDiscoveryClient();
Appsettings中编写
{
"Logging": {
"IncludeScopes": false,
"LogLevel": {
"Default": "Warning"
}
},
"spring": {
"application": {
"name": "order11111" //注入的名称
}
},
"eureka": {
"client": {
"serviceUrl": "http://192.168.130.132:8761/eureka/", //eureka地址
"shouldFetchRegistry": false,
"shouldRegisterWithEureka": true
},
"instance": {
"port": 8010
//"hostName": "localhost"
//"preferIpAddress": true,
//"instanceId": "agent-service-container:8010"
}
}
}
标签:oca war service ddd http desc pad get url
原文地址:https://www.cnblogs.com/ITzhangyunpeng/p/12178468.html