知行合一

博客园 首页 新随笔 联系 订阅 管理
上一页 1 ··· 10 11 12 13 14 15 16 17 18 ··· 37 下一页

2021年3月27日 #

摘要: 基于redisson实现分布式锁 一、上官网 https://redisson.org/ 二、pom文件引入依赖 <dependency> <groupId>org.redisson</groupId> <artifactId>redisson</artifactId> <version>3.11. 阅读全文
posted @ 2021-03-27 08:43 callbin 阅读(165) 评论(0) 推荐(0)

摘要: 基于Zookeeper的curator客户端实现分布式锁 一、进入官网 http://curator.apache.org 二、引入curator 的jar包 1、进入 https://mvnrepository.com/ 搜索 curator 2.Pom文件引入找到的jar包依赖 <depende 阅读全文
posted @ 2021-03-27 07:58 callbin 阅读(94) 评论(0) 推荐(0)

2021年3月26日 #

摘要: 1、Zookeeper的数据结构 二、zookeeper分布式锁原理 二、zookeeper分布式锁代码实现 1、maven依赖 (1)https://mvnrepository.com/ 搜索 zookeeper (2)选择安装的对应版本 (3) pom 文件 添加依赖 <dependency> 阅读全文
posted @ 2021-03-26 20:00 callbin 阅读(145) 评论(0) 推荐(0)

摘要: 一、基于分布式锁解决定时任务重复问题 1、定时任务部署集群 二、利用redis分布式锁解决定时任务重复发送短信 1、启用定时任务 package com.example.distributelock; import org.mybatis.spring.annotation.MapperScan; 阅读全文
posted @ 2021-03-26 19:32 callbin 阅读(837) 评论(0) 推荐(0)

摘要: 一、 redis分布式锁原理 并发 到Redis里变成了串行排队,单线程 二、基于Redis的Setnx实现分布式锁 1、pom <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-star 阅读全文
posted @ 2021-03-26 11:23 callbin 阅读(2202) 评论(0) 推荐(2)

摘要: 一、基于数据库悲观锁的分布式锁 代码 package com.example.distributelock.controller; import com.example.distributelock.dao.DistributeLockMapper; import com.example.distr 阅读全文
posted @ 2021-03-26 09:02 callbin 阅读(74) 评论(0) 推荐(0)

摘要: 一、如何使用锁解决电商中的超卖的问题? 1、模拟5个线程并发执行。使用CyclicBarrier类 package com.example.distributedemo; import com.example.distributedemo.service.OrderService; import o 阅读全文
posted @ 2021-03-26 07:33 callbin 阅读(121) 评论(0) 推荐(0)

2021年3月17日 #

摘要: 一 、RabbitMQ基础组件整体功能概述 二、基础组件开发 4各模块 common、api、core-product、task (一)、父工程 rabbit-parent 1.pom文件 <project xmlns="http://maven.apache.org/POM/4.0.0" xmln 阅读全文
posted @ 2021-03-17 21:44 callbin 阅读(225) 评论(0) 推荐(0)

摘要: 配置文件 \src\main\resources\application.properties server.servlet.context-path=/ server.port=8002 spring.rabbitmq.addresses=192.168.11.71:5672,192.168.11 阅读全文
posted @ 2021-03-17 19:38 callbin 阅读(196) 评论(0) 推荐(0)

2021年3月16日 #

摘要: 一、RabbitMQ与SpringBoot整合_生产端 <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-web</artifactId> </dependency> se 阅读全文
posted @ 2021-03-16 19:32 callbin 阅读(147) 评论(0) 推荐(0)

上一页 1 ··· 10 11 12 13 14 15 16 17 18 ··· 37 下一页