ColinChang.ConsulRestHelper 1.0.0

This is a utility can help you to send web requests to services registered to Consul.Like RestTemplate in Spring Cloud for Java.

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.

Install-Package ColinChang.ConsulRestHelper -Version 1.0.0
dotnet add package ColinChang.ConsulRestHelper --version 1.0.0
<PackageReference Include="ColinChang.ConsulRestHelper" Version="1.0.0" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add ColinChang.ConsulRestHelper --version 1.0.0
The NuGet Team does not provide support for this client. Please contact its maintainers for support.

This is a utility can help you to send web requests to services registered to Consul.Like RestTemplate in Spring Cloud for Java.

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.

    services.ElementAt(Environment.TickCount % services.Count());
    
  3. Rest Request

    sending Get/Post/Put/Delete web requests to services registered in consul.

Documents

  • https://colin-chang.site/netcore/pages/microservice-consul.html

This is a utility can help you to send web requests to services registered to Consul.Like RestTemplate in Spring Cloud for Java.

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.

    services.ElementAt(Environment.TickCount % services.Count());
    
  3. Rest Request

    sending Get/Post/Put/Delete web requests to services registered in consul.

Documents

  • https://colin-chang.site/netcore/pages/microservice-consul.html

Version History

Version Downloads Last updated
1.0.0 123 5/30/2019