Annotation Interface DistributedIdempotent


@Target(METHOD) @Retention(RUNTIME) public @interface DistributedIdempotent
分布式幂等
作者:
ok1996
  • 可选元素概要

    可选元素
    修饰符和类型
    可选元素
    说明
    long
    获取锁的最长等待时间
    long
    获取后持有锁的最长时间,如果它尚未通过调用unlock 。
    获取锁失败后的提示信息
    时间单位,默认为秒
    锁的名字,支持el表达式
  • 字段概要

    字段
    修饰符和类型
    字段
    说明
    static final String
     
  • 字段详细资料

  • 元素详细资料

    • value

      String value
      锁的名字,支持el表达式
        1.获取方法名称
            #methodName
        2.获取方法参数中的某个值
            void test(String id)  => #id
        3.不支持引用一个字符串常量然后和spel表达式拼接
        4.如果要拼接字符串:  "'test' + #id"
       
      默认值:
      "RedissonMethodName"
    • message

      String message
      获取锁失败后的提示信息
      返回:
      默认值:
      "\u64cd\u4f5c\u9891\u7e41\uff0c\u8bf7\u7a0d\u540e\u91cd\u8bd5!"
    • acquireTimeout

      long acquireTimeout
      获取锁的最长等待时间
      默认值:
      0L
    • expireTime

      long expireTime
      获取后持有锁的最长时间,如果它尚未通过调用unlock 。 如果leaseTime 为-1,则保持锁定直到明确解锁。
      默认值:
      10L
    • unit

      TimeUnit unit
      时间单位,默认为秒
      返回:
      TimeUnit
      默认值:
      SECONDS