Skip to content

feat: 新增etcd分布式锁实现模块,修复租约管理问题,增强配置功能,添加完整测试覆盖#23

Open
Jpl-hub wants to merge 1 commit intobaomidou:masterfrom
Jpl-hub:feature-new-distributed-lock
Open

feat: 新增etcd分布式锁实现模块,修复租约管理问题,增强配置功能,添加完整测试覆盖#23
Jpl-hub wants to merge 1 commit intobaomidou:masterfrom
Jpl-hub:feature-new-distributed-lock

Conversation

@Jpl-hub
Copy link

@Jpl-hub Jpl-hub commented Jun 19, 2025

What kind of change does this PR introduce? (check at least one)

  • Bugfix
  • Feature
  • Code style
  • Refactor
  • Doc
  • Other, please describe:

The description of the PR:

描述

为 lock4j 新增 etcd 分布式锁实现,丰富分布式锁选择。

新增功能

  • 完整的 etcd 分布式锁模块 lock4j-etcd-spring-boot-starter
  • 基于 jetcd-core 的锁实现
  • Spring Boot 自动配置支持
  • 注解式和编程式两种使用方式

主要特性

  • 🔒 基于 etcd 租约机制的分布式锁
  • ⚡ 自动租约管理,防止死锁
  • 🔧 支持多端点、认证等配置
  • 📝 与现有 Redis/Zookeeper 实现保持一致的 API

使用示例

lock4j:
  etcd:
    endpoints: "http://localhost:2379"
@EtcdLock(keys = {"#orderId"})
public void processOrder(String orderId) {
    // 业务逻辑
}


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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant