Skip to content
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

Proposal : Out of the box support for distributed locks #173

Open
daniellavoie opened this issue Jan 30, 2017 · 5 comments
Open

Proposal : Out of the box support for distributed locks #173

daniellavoie opened this issue Jan 30, 2017 · 5 comments

Comments

@daniellavoie
Copy link

I'll admit this might not be the best place to open the discussion but I couldn't find anywhere else.

Once upon a time we had Spring Cloud Cluster supporting Lock Registry which was deprecated into Spring Integration. Tell me if I am wrong but even if I add dependencies from Spring Integration it doesn't feel to me that it just works out of the box with the COC so dear to the Spring Boot phylosophy. We need to do a couple of plumbing to have something working out.

Distributed Locks for internal batches or croned services is a recurrent topic in my opinion in a distributed system. I would like to contribute to a starter module inspired by your sample Lock Server Demo. We have a starter server for Eureka and the Config Server. Why not treating locks as a first class citizen among the problems eased by Spring Cloud with a starter server project and a starter client.

I'll work on my own embeddable server and client but it feels to me that such feature would make sense to be part of the project.

@spencergibb
Copy link
Member

What is 'COC'?

works out of the box with the COC so dear to the Spring Boot

See spring-cloud/spring-cloud-zookeeper#93 for a similar request for leader election.

@daniellavoie
Copy link
Author

Convention Over Configuration ;)

@spencergibb
Copy link
Member

OK. I wouldn't call auto-configuration, convention over configuration though, but that's neither here nor there.

@daniellavoie
Copy link
Author

daniellavoie commented Jan 30, 2017

Yeah sure, word abuse is easy.

I've been giving Spring Cloud training for a while and the same question keeps coming over and over : "What about croned tasks".

I wish I had a simple answer as easy as a config server or service discovery. As stated by the issue you sent me, SI is message oriented. I am also dreaming of a solution wider than Zookeeper. The sample lock server is interresting in that matter. I'm interested in gathering opinions.

Edit 2017/02/01 : So here is a first draft of a LockServer. It is more than freely inspired by the Config Server and Dave's locksdemo exemples (copy/pasted would be a better term).

https://github.com/daniellavoie/spring-cloud-lock

For what it's worth, it provides an @EnableLockServer annotation. Next step, I'll implement an auto-configurable client.

@daniellavoie
Copy link
Author

daniellavoie commented Feb 1, 2017

I'll continue my work trying to implement a @LeaderOnly kind of annotation for the client. I really like that proposal from spring-cloud/spring-cloud-zookeeper#93.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants