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.
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
.