MSHelper.Discovery.Consul 1.0.0

dotnet add package MSHelper.Discovery.Consul --version 1.0.0
                    
NuGet\Install-Package MSHelper.Discovery.Consul -Version 1.0.0
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="MSHelper.Discovery.Consul" Version="1.0.0" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="MSHelper.Discovery.Consul" Version="1.0.0" />
                    
Directory.Packages.props
<PackageReference Include="MSHelper.Discovery.Consul" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add MSHelper.Discovery.Consul --version 1.0.0
                    
#r "nuget: MSHelper.Discovery.Consul, 1.0.0"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package MSHelper.Discovery.Consul@1.0.0
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=MSHelper.Discovery.Consul&version=1.0.0
                    
Install as a Cake Addin
#tool nuget:?package=MSHelper.Discovery.Consul&version=1.0.0
                    
Install as a Cake Tool

MSHelper.Discovery.Consul : Service Discovery

⭐ Star us on GitHub � it motivates us a lot!

Overview

Provides ConsulServiceDiscoveryMessageHandler (used by IHttpClient) that integrates with Consul service discovery mechanism.

Installation

This document is for the latest MSHelper.Discovery.Consul 1.0.0 release and later.

dotnet add package MSHelper.Discovery.Consul

Dependencies

-- MSHelper

-- MSHelper.HTTP

Usage

Extend IMSHelperBuilder with AddConsul() that will register the required services.

public static IMSHelperBuilder RegisterMSHelper(this IMSHelperBuilder builder)
{
    builder
        .AddHttpClient()
        .AddConsul();
    // Other services.

    return builder;
}

Options

--- enabled - determines whether Consul integration is going to be available.

--- url - URL of the Consul service.

--- service - name of the service group (multiple instances of the same service will use the same service name).

--- address - address of the service.

--- port - port under which the service is available.

--- pingEnabled - register health checks from Consul to validate the service availability (if the service will be offline, it will be removed after the pingInterval and removeAfterInterval timeouts).

--- pingEndpoint - an endpoint that should be called when performing the healt check by Consul.

appsettings.json

"consul": {
  "enabled": true,
  "url": "http://localhost:8500",
  "service": "some-service",
  "address": "localhost",
  "port": "5000",
  "pingEnabled": true,
  "pingEndpoint": "ping",
  "pingInterval": 3,
  "removeAfterInterval": 3
}

Important Note:

All the MSHelper packages are for self learning purposes inspired by Devmentors.io

Product Compatible and additional computed target framework versions.
.NET net6.0 is compatible.  net6.0-android was computed.  net6.0-ios was computed.  net6.0-maccatalyst was computed.  net6.0-macos was computed.  net6.0-tvos was computed.  net6.0-windows was computed.  net7.0 was computed.  net7.0-android was computed.  net7.0-ios was computed.  net7.0-maccatalyst was computed.  net7.0-macos was computed.  net7.0-tvos was computed.  net7.0-windows was computed.  net8.0 was computed.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed.  net9.0 was computed.  net9.0-android was computed.  net9.0-browser was computed.  net9.0-ios was computed.  net9.0-maccatalyst was computed.  net9.0-macos was computed.  net9.0-tvos was computed.  net9.0-windows was computed.  net10.0 was computed.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages (2)

Showing the top 2 NuGet packages that depend on MSHelper.Discovery.Consul:

Package Downloads
MSHelper.LoadBalancing.Fabio

MSHelper.LoadBalancing.Fabio - integrates with Fabio load balancer

MSHelper.HTTP.RestEase

MSHelper.HTTP.RestEase - RestEase Integration

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
1.0.0 352 10/25/2022