I'm lazy. Directly on the diagram of the configuration file
Where servicename is the service name,
LoadBalancer is a load balancing strategy. For the flow control I write a 1s limit of 5 requests to do the test.
The rest of the names will be OK.
A prerequisite to using service discovery is consul. I this is for the test demo, the service address hardcoded in the Consul configuration file, the start of consul when the file service is registered.
To understand Ocelot in depth, middleware must be understood.
Ocelot is a development framework that we definitely want to extend to real projects. can refer to Ocelot.configeditor address: Https://github.com/dbarkwell/Ocelot.ConfigEditor.
These are some of the things that get you started, and it's a big factor for developers to use this framework at a very fast pace. It was a good friend. The results of a Chinese document sharing a Ocelot configuration file in a. NET Group I lost the document because I did the system again. I try to turn over and share it.
Ocelotapi Simple use-service discovery, flow control