-
Notifications
You must be signed in to change notification settings - Fork 1.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Consul Service Discovery Not Working With Dynamic Routing #655
Comments
|
@mikejr83 thanks for your PR! I will merge it ASAP. |
|
I have the same problem, please kindly release the new version as soon as possible |
|
Dude, I can't wait for your version |
|
LOL. I've been just building it and replacing the binary in the NuGet path. It was driving me bonkers on this PoC I'm working on. |
|
@mikejr83 Thank you for your hard work |
|
When will it be updated to the nuget repository? |
|
Guys any plan to release new Nuget Package ? I need urgently use dynamic routes and this is blocking me! |
|
me too. @thiagoloureiro |
|
me too |
|
Is there a new version? Have the same problem :( |
|
The same problem,I have to downgrade from 12.0.1 version to 12.0.0 |
|
available in version 13.0.0 on nuget |
Expected Behavior
Use Ocelot and Consul for service discovery and dynamic routing.
Actual Behavior
Without defining
ReRoutesan error occurs.Steps to Reproduce the Problem
Ocelot.Provider.ConsulSpecifications
Error
Configuration
Ocelot
The configuration is pulled from
appsettings.json:{ "ReRoutes": [], "Aggregates": [], "GlobalConfiguration": { "RequestIdKey": null, "ServiceDiscoveryProvider": { "ConfigurationKey": "Ocelot", "Host": "localhost", "Port": 8500, "Type": "Consul" }, "RateLimitOptions": { "ClientIdHeader": "ClientId", "QuotaExceededMessage": null, "RateLimitCounterPrefix": "ocelot", "DisableRateLimitHeaders": false, "HttpStatusCode": 429 }, "QoSOptions": { "ExceptionsAllowedBeforeBreaking": 0, "DurationOfBreak": 0, "TimeoutValue": 0 }, "LoadBalancerOptions": { "Type": "LeastConnection" }, "DownstreamScheme": "http", "HttpHandlerOptions": { "AllowAutoRedirect": false, "UseCookieContainer": false, "UseTracing": false } } }Consul
The service self-registers with Consul on startup.
{ "ID": "098a60b3-9e77-d3e1-ccb7-56580afadb74", "Node": "54060bfe6310", "Address": "127.0.0.1", "Datacenter": "dc1", "TaggedAddresses": { "lan": "127.0.0.1", "wan": "127.0.0.1" }, "NodeMeta": { "consul-network-segment": "" }, "ServiceKind": "", "ServiceID": "background-forms-api-v1-final-01-192.168.1.203-5000", "ServiceName": "background-forms-api", "ServiceTags": [ "Forms" ], "ServiceAddress": "192.168.1.203", "ServiceWeights": { "Passing": 1, "Warning": 1 }, "ServiceMeta": { "BoolTest": "\"True\"", "DecimalTest": "\"12.3\"", "Scopes": "[\"oidc\",\"name\",\"email\",\"gender\",\"birthdate\",\"zoneinfo\",\"locale\",\"phone_number\",\"address\"]", "StringTest": "\"Hello\"" }, "ServicePort": 5000, "ServiceEnableTagOverride": false, "ServiceProxyDestination": "", "ServiceConnect": { "Native": false, "Proxy": null }, "CreateIndex": 396, "ModifyIndex": 580 }Description
I've setup a basic API gateway in .NET Core 2.1 using Ocelot. The goal is to have the API gateway configure its routing based on the information inside of a service registry.
To meet this I've setup Consul and have services self-register as they come on-line. Ocelot should then be able to use Consul to determine the routes for downstream services.
When I attempt to do this per the configuration I get the above error. If I change my configuration to manually put the route information into
ReRoutesOcelot will detect the host and port information from Consul and redirect the request.I tried to trace what is going on during the configuration of Ocelot. To me it seems that the
ConsulProviderFactory.Getis never executed in the case where theReRoutesarray is empty.The text was updated successfully, but these errors were encountered: