我是
microservices
架构的新手,并且已经使用单个 ocelot.json
文件实现了微服务和 API 网关,如下图所示。
您可以看到
ocelot.json
项目中有一个 Gateway.WebApi
文件,其中包含路线。
哪一个是处理此问题的更好选择?
ocelot.json
适用于所有微服务ocelot.json
我们可以为每个微服务做一些类似的事情吗?
builder.Configuration.AddJsonFile("ocelot.json", 可选: false, reloadOnChange: true); //Master相关API
builder.Configuration.AddJsonFile("ocelot2.json", optional: false, reloadOnChange: true);//短信服务相关API
builder.Configuration.AddJsonFile("ocelot3.json", optional: false, reloadOnChange: true);//用于登录注册相关API