//"instanceId": "agent-service-container:8010" } } } NetCor
首先先安置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"
}
}
}
NetCore去注册Eureka
,温馨提示: 本文由Jm博客推荐,转载请保留链接: https://www.jmwww.net/file/web/31842.html