Redis Lock Spring boot starter

Redis Lock 的 spring boot 自启动项目

License

License

Categories

Categories

Spring Boot Container Microservices Redis Data Databases
GroupId

GroupId

io.github.spring-tools
ArtifactId

ArtifactId

redis-lock-spring-boot-starter
Last Version

Last Version

1.1.0
Release Date

Release Date

Type

Type

jar
Description

Description

Redis Lock Spring boot starter
Redis Lock 的 spring boot 自启动项目

Download redis-lock-spring-boot-starter

How to add to project

<!-- https://jarcasting.com/artifacts/io.github.spring-tools/redis-lock-spring-boot-starter/ -->
<dependency>
    <groupId>io.github.spring-tools</groupId>
    <artifactId>redis-lock-spring-boot-starter</artifactId>
    <version>1.1.0</version>
</dependency>
// https://jarcasting.com/artifacts/io.github.spring-tools/redis-lock-spring-boot-starter/
implementation 'io.github.spring-tools:redis-lock-spring-boot-starter:1.1.0'
// https://jarcasting.com/artifacts/io.github.spring-tools/redis-lock-spring-boot-starter/
implementation ("io.github.spring-tools:redis-lock-spring-boot-starter:1.1.0")
'io.github.spring-tools:redis-lock-spring-boot-starter:jar:1.1.0'
<dependency org="io.github.spring-tools" name="redis-lock-spring-boot-starter" rev="1.1.0">
  <artifact name="redis-lock-spring-boot-starter" type="jar" />
</dependency>
@Grapes(
@Grab(group='io.github.spring-tools', module='redis-lock-spring-boot-starter', version='1.1.0')
)
libraryDependencies += "io.github.spring-tools" % "redis-lock-spring-boot-starter" % "1.1.0"
[io.github.spring-tools/redis-lock-spring-boot-starter "1.1.0"]

Dependencies

compile (5)

Group / Artifact Type Version
io.github.spring-tools : redis-lock jar 1.1.0
org.springframework.boot : spring-boot-autoconfigure jar
org.projectlombok : lombok Optional jar 1.18.10
org.springframework : spring-context jar
org.slf4j : slf4j-api Optional jar

test (3)

Group / Artifact Type Version
junit : junit jar
org.springframework.boot : spring-boot-starter-test jar
org.springframework.boot : spring-boot-starter-data-redis jar

Project Modules

There are no modules declared in this project.

redis-tools

介绍

基于 Spring 实现的 Redis 工具包,暂时支持:

Lock

Redis 的 分布式锁,支持特性:

  1. 重入
  2. 降级
  3. 回滚
  4. 自旋
  5. 支持 enable 引用 和 starter 的开箱即用方式。

具体介绍Redis-Lock

当前最新版本 lastVersion = 1.1.0

1、MAVEN 引用

<dependency>
   <groupId>io.github.spring-tools</groupId>
   <artifactId>redis-lock-spring-boot-starter</artifactId>
   <version>${lastVersion}</version>
</dependency>

2. try/finally 使用

    // 来一个 try-with-resource 模式
    IRedisLock lock = RedisLockBuilder.builder(LOCK_KEY).build();
    try{
        Assert.assertTrue(lock.tryLock());
    }finally{
        lock.unlock();
    }

版本更新

  • 1.0.0 发布 (2020-02-24)

完成了基本框架和分布式锁实现。

Versions

Version
1.1.0
1.0.0