micronaut-projects / micronaut-discovery-client

Micronaut's Discovery Client
Apache License 2.0
22 stars 20 forks source link

ConsulClient should provide session and lock management methods #302

Open asarkar opened 5 years ago

asarkar commented 5 years ago

v1.1.0.RC2. ConsulClient currently doesn't provide any methods for releasing and acquiring locks and sessions. https://www.consul.io/docs/internals/sessions.html

In addition to service discovery and distributed configuration management, sessions API is a very useful mechanism in Consul for implementing leader election or distributed semaphores. I had no previous experience working with Micronaut, or Consul, but I was able to come up with this class that gets the basic job done. Perhaps you could improve on it to add session management to the ConsulClient.

graemerocher commented 5 years ago

Thanks for the feedback PRs are welcome