README.md

    spring-boot-starter-idempotent

    一个基于 Spring Boot Redis 的 幂等

    License-Anti Link-996 QQ群

    为简化开发工作、提高生产率、解决常见问题而生

    分支

    • main
      • 支持 JDK 8、11
    • next
      • 支持 JDK 17

    其他 Spring Boot Starter 项目

    发布

    更新日志

    代码格式规范 spring-javaformat

    功能说明

    • 支持一键代码开启全局幂等配置(cn.com.xuxiaowei.boot.idempotent.annotation.EnableIdempotent
    • 支持一键开启多次获取请求流(xxw.idempotent.input-stream-filter: true
    • 支持自定义全局接口幂等放入Redis中的key值前缀(xxw.idempotent.prefix
    • 支持自定义全局接口幂等调用记录放入Redis中的key值前缀(xxw.idempotent.record
    • 支持自定义全局接口幂等调用结果放入Redis中的key值前缀(xxw.idempotent.result
    • 支持自定义接口幂等放入Redis中的key值(cn.com.xuxiaowei.boot.idempotent.annotation.Idempotent#key()
    • 支持自定义接口幂等Token从header中获取(第一优先级cn.com.xuxiaowei.boot.idempotent.annotation.Idempotent#header()
    • 支持自定义接口幂等Token从param中获取(第二优先级cn.com.xuxiaowei.boot.idempotent.annotation.Idempotent#param()
    • 支持自定义接口幂等Token从stream中获取(第三优先级cn.com.xuxiaowei.boot.idempotent.annotation.Idempotent#stream() ,需要开启多次获取请求流配置)
    • 支持自定义接口幂等Token名称
    • 支持自定义幂等过期时间(cn.com.xuxiaowei.boot.idempotent.annotation.Idempotent#expireTime()
    • 支持自定义幂等过期时间单位(cn.com.xuxiaowei.boot.idempotent.annotation.Idempotent#expireUnit()
    • 支持自定义接口超时时直接响应空结果(响应header中响应调用记录)与自定义响应结果
    • 支持严格模式(未找到Token时抛出异常,使用@org.springframework.web.bind.annotation.ControllerAdvice统一拦截异常进行处理)
    • 支持将调用记录放入响应header中

    使用示例

    <!-- https://search.maven.org/artifact/cn.com.xuxiaowei.boot/spring-boot-starter-idempotent -->
    <!-- https://mvnrepository.com/artifact/cn.com.xuxiaowei.boot/spring-boot-starter-idempotent -->
    <dependency>
        <groupId>cn.com.xuxiaowei.boot</groupId>
        <artifactId>spring-boot-starter-idempotent</artifactId>
        <version>最新版</version>
    </dependency>
    • 由于各大 maven 仓库(如:阿里云)非实时同步,推荐在项目 pom.xml 中添加下列仓库
    
    <repositories>
        <repository>
            <id>releases</id>
            <url>https://s01.oss.sonatype.org/content/repositories/releases/</url>
            <releases>
                <enabled>true</enabled>
            </releases>
            <snapshots>
                <enabled>false</enabled>
            </snapshots>
        </repository>
        <repository>
            <id>snapshots</id>
            <url>https://s01.oss.sonatype.org/content/repositories/snapshots/</url>
            <releases>
                <enabled>false</enabled>
            </releases>
            <snapshots>
                <enabled>true</enabled>
            </snapshots>
        </repository>
    </repositories>

    依赖

    • spring-boot-starter-aop

    • spring-boot-starter-data-redis

    • spring-boot-starter-web

    • spring-boot-configuration-processor

    • lombok

    批量添加远端仓库地址

    点击展开 git remote add gitee https://gitee.com/xuxiaowei-com-cn/spring-boot-starter-idempotent.git

    git remote add gitlab https://gitlab.com/xuxiaowei-com-cn/spring-boot-starter-idempotent.git

    git remote add framagit https://framagit.org/xuxiaowei-com-cn/spring-boot-starter-idempotent.git

    git remote add github https://github.com/xuxiaowei-com-cn/spring-boot-starter-idempotent.git

    git remote add gitcode https://gitcode.net/xuxiaowei-com-cn/spring-boot-starter-idempotent.git

    git remote add gitlink https://gitlink.org.cn/xuxiaowei-com-cn/spring-boot-starter-idempotent.git

    参考文档

    1. 一个基于 Spring Boot Redis 的幂等【流程图】

    鸣谢

    1. 感谢 jetbrains 提供开发工具 IDEA 的免费授权

    Stargazers over time

    Stargazers over time

    项目简介

    一个基于 Spring Boot Redis 的幂等组件

    发行版本 9

    0.0.1-alpha.9 发布

    全部发行版

    贡献者 2

    徐晓伟 @qq_32596527
    D dependabot[bot] @dependabot[bot]

    开发语言

    • Java 99.0 %
    • HTML 1.0 %