Skip to content

yahai8/idempotency

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

idempotency

基于spring boot+redis+拦截器实现接口幂等性,譬如:订单支付等

访问localhost:8080/token,获取token

然后使用jmeter进行并发测试,开启50个线程并发访问

定义请求头header并携带token

访问http://localhost:8080/idempotent/save

可以看出,50个线程并发访问只有一个接口访问成功,这就实现了接口幂等性

数据库里面也只插入了一条信息

About

接口幂等性,譬如:订单支付等

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages