Giter Site home page Giter Site logo

threemammals / ocelot.provider.consul Goto Github PK

View Code? Open in Web Editor NEW
18.0 12.0 14.0 123 KB

Repo for Consul integration with Ocelot

Home Page: http://threemammals.com/ocelot

License: MIT License

PowerShell 5.08% C# 92.93% Shell 1.98%
dotnetcore aspdotnet ocelot consul

ocelot.provider.consul's Introduction

Build status Windows (AppVeyor) Build Status Linux & OSX (Travis)

Coverage Status

Ocelot

This package adds Consul support to Ocelot via the package Consul.NET.

How to install

Ocelot is designed to work with ASP.NET Core only and it targets netstandard2.0. This means it can be used anywhere .NET Standard 2.0 is supported, including .NET Core 2.1 and .NET Framework 4.7.2 and up. This documentation may prove helpful when working out if Ocelot would be suitable for you.

Install Ocelot and it's dependencies using NuGet.

Install-Package Ocelot.Provider.Consul

Or via the .NET Core CLI:

dotnet add package Ocelot.Provider.Consul

All versions can be found here

Documentation

Please click here for the Ocleot serviec discovery documentation and here for storing configuration in Consul. This includes lots of information and will be helpful if you want to understand the features Ocelot currently offers.

Contributing

We love to receive contributions from the community so please keep them coming :)

Pull requests, issues and commentary welcome!

Please complete the relevant template for issues and PRs. Sometimes it's worth getting in touch with us to discuss changes before doing any work incase this is something we are already doing or it might not make sense. We can also give advice on the easiest way to do things :)

Finally we mark all existing issues as help wanted, small, medium and large effort. If you want to contribute for the first time I suggest looking at a help wanted & small effort issue :)

Donate

If you think this project is worth supporting financially please make a contribution using the button below!

Support via PayPal

ocelot.provider.consul's People

Contributors

tompallister avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

ocelot.provider.consul's Issues

Service should use Node address if not populated

When a health check in Consul returns, it can have a null Address. This is because services can be registered with an empty address. The docs at https://www.consul.io/api/agent/service.html say:

Address (string: "") - Specifies the address of the service. If not provided, the agent's address is used as the address for the service during DNS queries.

If a service doesn't have an address then Ocelot should use the node address instead

Service address does not allow url path or scheme

Expected Behaviour

I should be able to specify a scheme and url path for a service address in consul, for instance

"address": "http://mydomain.com/MyService/",

This is valid consul configuration (although I appreciate that it might not be a common way of configuring consul), as we are using it in production at the moment.

Actual Behaviour

I get an error:

to use service Address: http://mydomain.com/MyService/ and Port: 80 as it is invalid. Address must contain host only e.g. localhost and port must be greater than 0

Steps to Reproduce the Problem

Register a service in consul with an address similar to above.
Register consul in ocelot, similar to below

{
    "ReRoutes": [
        {
            "DownstreamPathTemplate": "/MyService/{test}",
            "DownstreamScheme": "http",
            "UpstreamPathTemplate": "/{test}",
            "UpstreamHttpMethod": [ "GET" ],
            "ServiceName": "MyService",
            "LoadBalancerOptions": {
                "Type": "LeastConnection"
            },
            "UpstreamHeaderTransform": {
                "Accept": "application/json"
            }
        }
    ],
    "GlobalConfiguration": {
        "BaseUrl": "http://localhost:5000/",
        "ServiceDiscoveryProvider": {
            "Host": "localhost",
            "Port": 8500,
            "Type": "Consul"
        }
    }

Specifications

  • Version: 11.0.2
  • Platform: Windows
  • Subsystem: Ocelot.Provider.Consul

Thanks!

fix travis build

Expected Behavior / New Feature

Actual Behavior / Motivation for New Feature

Steps to Reproduce the Problem

Specifications

  • Version:
  • Platform:
  • Subsystem:

Ocelot V11.0.0๏ผŒ AddConfigStoredInConsul Exception

Expected Behavior / New Feature

MissingMethodException: Method not found: 'Void Ocelot.Cache.IOcelotCache`1.AddAndDelete(System.String, !0, System.TimeSpan, System.String)'.

Actual Behavior / Motivation for New Feature

Steps to Reproduce the Problem

Specifications

  • Version:0.1.1
  • Platform:
  • Subsystem:

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.