Named Locks using Redisson
This module implement named locks using Redisson. It provides two implementations, that are distributed and rely on Redisson distributed objects feature.
Out of the box “redisson” (distributed) named lock implementations are the following:
rwlock-redisson
implemented inorg.eclipse.aether.named.redisson.RedissonReadWriteLockNamedLockFactory
that uses Redisson-backedorg.redisson.api.RReadWriteLock
.semaphore-redisson
implemented inorg.eclipse.aether.named.redisson.RedissonSemaphoreNamedLockFactory
that uses Redisson-backedorg.redisson.api.RSemaphore
.
Open Issues/Notes
- Usage from plugins and extensions hasn't been fully tested yet.
Open Issues/Notes for Maven Resolver integrators
To use this implementation within your project, depending on how you integrate, you have following options:
- If you use Sisu DI, then all you need is to provide this module (and its dependencies) on classpath and you are done.
- If you use Guice, you need to add this module (and its dependencies) upfront, and bind them explicitly.
- If you use ServiceLocator, this module will not work.
Installation/Testing
- Create the directory
${maven.home}/lib/ext/redisson/
. - Copy the following dependencies from Maven Central to
${maven.home}/lib/ext/redisson/
:├── maven-resolver-named-locks-redisson-1.9.7.jar ├── redisson-3.17.7.jar ├── jackson-annotations-2.13.4.jar ├── jackson-core-2.13.4.jar ├── jackson-databind-2.13.4.jar ├── jackson-dataformat-yaml-2.13.4.jar ├── jboss-marshalling-2.0.11.Final.jar ├── jboss-marshalling-river-2.0.11.Final.jar ├── netty-buffer-4.1.82.Final.jar ├── netty-codec-4.1.82.Final.jar ├── netty-codec-dns-4.1.82.Final.jar ├── netty-common-4.1.82.Final.jar ├── netty-handler-4.1.82.Final.jar ├── netty-resolver-4.1.82.Final.jar ├── netty-resolver-dns-4.1.82.Final.jar ├── netty-transport-4.1.82.Final.jar └── snakeyaml-1.31.jar
- Start your Redis instance on
localhost
or configure a remote instance with${maven.conf}/maven-resolver-redisson.yaml
. - Now start a multithreaded Maven build or multiple builds (e.g., CI server) on your project.