Skip to content

【QA】Lock4j注解在接口的方法上使用,每个实现类的方法都会生效吗? #25

@tanpenggood

Description

@tanpenggood

Enviroment

  • JDK Version: 1.8
  • SpringBoot Version: 2.6.8
  • Lock4j Version: 2.2.7

Code

public interface ILock4jDemoService {

    /**
     * 自动续期+自动释放锁
     *
     * @param amount
     */
    @Lock4j(keys = {"'pay'", "#amount"},
            expire = -1, // -1代表根据业务方法执行时间自动续期
            autoRelease = true, // 业务方法执行结束自动释放锁
            executor = RedissonLockExecutor.class,
            failStrategy = CustomLockFailureStrategy.class)
    void autoRenewAndAutoReleaseLock(BigDecimal amount);
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions