Info
Version: | 1.0.0 |
Author(s): | ColinChang.ConsulRestHelper |
Last Update: | Thursday, May 30, 2019 |
.NET Fiddle: | Create the first Fiddle |
Project Url: | https://github.com/colin-chang/ConsulRestHelper/tree/master |
NuGet Url: | https://www.nuget.org/packages/ColinChang.ConsulRestHelper |
Install
Install-Package ColinChang.ConsulRestHelper
dotnet add package ColinChang.ConsulRestHelper
paket add ColinChang.ConsulRestHelper
ColinChang.ConsulRestHelper Download (Unzip the "nupkg" after downloading)
Dependencies
- Consul(>= 0.7.2.6)
- Newtonsoft.Json(>= 12.0.2)
Tags
It has some functions below.
1.
Service discovery.
It can transfer virtual service request to a real instance service request.Like "http://ProductService/api/product/" => "http://192.168.1.10:8080/api/product/".
2. Load balancing
By default,we use the milliseconds elapsed since the system started to mocke up the total count of services registered to consul to get one of the service instance.
```csharp
services.ElementAt(Environment.TickCount % services.Count());
```
3.
Rest Request
sending Get/Post/Put/Delete web requests to services registered in consul.