Service discovery and "PollConsul" type: ServicesAreEmptyError
See original GitHub issueI was trying to access a microservice called UserManagement from an ocelot api gateway but when attempting the request, i got the following error in logs:
and here is my ocelot.json file :
{
"Routes": [
{
"UseServiceDiscovery": true,
"DownstreamPathTemplate": "/{url}",
"DownstreamScheme": "http",
"ServiceName": "UserManagement",
"UpstreamPathTemplate": "/gateway/{url}",
"UpstreamHttpMethod": [ "Get", "POST" ],
"ReRoutesCaseSensitive": false,
"LoadBalancerOptions": {
"Type": "LeastConnection"
}
}
],
"GlobalConfiguration": {
"ServiceDiscoveryProvider": {
"Host": "localhost",
"Port": 8500,
"Type": "PollConsul", // !!!
"PollingInterval": 100
}
}
}
And the service was successfully registered because I can clearly see it’s in consul UI dashboard in services list. I appreciate any help because it’s an urgent matter! P.S: The following steps were produced without Docker, just a normal web API.
Issue Analytics
- State:
- Created 8 months ago
- Reactions:1
- Comments:10 (5 by maintainers)
Top Results From Across the Web
Two problems in Ocelot Service Discovery using Consul
Same problem here. When I hit an API for the first time, always returns 404 ServicesAreEmptyError Message: services were empty for UsersService ...
Read more >Service Discovery — Ocelot 1.0.0 documentation
Service Discovery ¶. Ocelot allows you to specify a service discovery provider and will use this to find the host and port for...
Read more >Service Discovery in a Microservices Architecture
Explore the service discovery within a microservices architecture, including client-side and server-side discovery patterns, the service ...
Read more >Service Discovery Explained | Consul
Service discovery dynamically tracks and monitors service instances on your network and makes them discoverable through DNS queries.
Read more >Service discovery
Service discovery uses AWS Cloud Map API actions to manage HTTP and DNS namespaces ... Service Discovery conceptsService discovery considerationsAmazon ECS ...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
By the way, the PR should address the following issues: https://github.com/ThreeMammals/Ocelot/issues/1304 https://github.com/ThreeMammals/Ocelot/issues/1329 https://github.com/ThreeMammals/Ocelot/issues/1487 Some PR are related: https://github.com/ThreeMammals/Ocelot/pull/1572 https://github.com/ThreeMammals/Ocelot/pull/1562
Hello @raman-m I will delete my forked repo, refork the current official repo, import the changes to the solution, make sure the tests are passing and then I will create a PR, probably tomorrow in the afternoon or on wednesday morning.