keylock

Key lock project for spring boot

License

License

Categories

Categories

KeY Data Data Formats Formal Verification
GroupId

GroupId

cn.javasalon
ArtifactId

ArtifactId

keylock
Last Version

Last Version

0.0.1
Release Date

Release Date

Type

Type

jar
Description

Description

keylock
Key lock project for spring boot
Project URL

Project URL

https://github.com/javasalon/keylock
Source Code Management

Source Code Management

https://github.com/javasalon/keylock.git

Download keylock

How to add to project

<!-- https://jarcasting.com/artifacts/cn.javasalon/keylock/ -->
<dependency>
    <groupId>cn.javasalon</groupId>
    <artifactId>keylock</artifactId>
    <version>0.0.1</version>
</dependency>
// https://jarcasting.com/artifacts/cn.javasalon/keylock/
implementation 'cn.javasalon:keylock:0.0.1'
// https://jarcasting.com/artifacts/cn.javasalon/keylock/
implementation ("cn.javasalon:keylock:0.0.1")
'cn.javasalon:keylock:jar:0.0.1'
<dependency org="cn.javasalon" name="keylock" rev="0.0.1">
  <artifact name="keylock" type="jar" />
</dependency>
@Grapes(
@Grab(group='cn.javasalon', module='keylock', version='0.0.1')
)
libraryDependencies += "cn.javasalon" % "keylock" % "0.0.1"
[cn.javasalon/keylock "0.0.1"]

Dependencies

compile (6)

Group / Artifact Type Version
org.springframework.boot : spring-boot-starter jar 2.4.2
org.springframework.boot : spring-boot-starter-aop jar 2.4.2
org.projectlombok : lombok Optional jar 1.18.16
org.springframework.boot : spring-boot-starter-cache jar 2.4.2
org.springframework.boot : spring-boot-starter-data-redis jar 2.4.2
org.redisson : redisson-spring-boot-starter jar 3.15.0

test (1)

Group / Artifact Type Version
org.springframework.boot : spring-boot-starter-test jar 2.4.2

Project Modules

There are no modules declared in this project.

KeyLock

简介

redis分布式锁,基于springboot2使用

功能介绍

  1. 以注解的形式快速实现分布式锁的功能
  2. 支持锁续命功能
  3. 支持锁某一条数据,可解决重复提交问题
  4. 支持controller、service层的注解

使用技术

  1. springboot2
  2. redis
  3. redisson

使用说明

  1. 引用依赖包
<dependency>
    <groupId>cn.javasalon</groupId>
    <artifactId>keylock</artifactId>
    <version>0.0.1</version>
</dependency>    
  1. 注解示例
@KeyLock("#s.id+#t.id+#name")
public void demo(Student s,Teacher t, String name){
    //TODO
}

-更多属性-
waitSecond:等待锁的时间,单位(秒)
leaseSecond: 默认-1会进行锁续期,释放时间是30S,其他不续期,使用默认即可
message: 获取不到锁的提示信息

springel 表达式的占位符为 “#” 使用时 可以传入整个对象,也可以传入对象中的属性,根据实际情况而定

  1. 配置redis连接
https://github.com/redisson/redisson/tree/master/redisson-spring-boot-starter

其他

  1. GIT仓库
   https://github.com/javasalon/keylock.git
   https://gitee.com/javasalon/keylock.git
  1. QQ交流群
145612313
  1. 发布中央仓库
mvn clean deploy -P release -Dmaven.test.skip=true

https://central.sonatype.org/pages/apache-maven.html

cn.javasalon

Javasalon

Versions

Version
0.0.1