Skip to content

PrinsWu/consulservicefinder

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Consul Service Finder

I got a problem when I try to simulate multiple service register on Consul server and the client can find one of the services to use the API.

I can use below URL to get all services but that is not what I want.

curl http://localhost:8500/v1/agent/services

Ideas

* Consul Query to search service by service name

* Count the service be used

* Return min count of services by same service name

Example


    csf = ConsulServiceFinder()
    
    # create query by service name
    csf.createQueryByServiceName("microweb_microtalk", "q_test")

    # find one service and compose it's url
    csf.composeServiceUrl(csf.requestOneServiceByServiceName("microweb_microtalk"))
    

About

Find service from consul with consul query

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages