GithubHelp home page GithubHelp logo

spring-boot-student's Introduction

layering-cache是一个支持分布式环境的多级缓存框架,使用方式和spring-cache类似。一级缓存使用Caffeine作为本地缓存,二级缓存使用redis作为集中式缓存。一级缓存和二级缓存的数据一致性是通过推和拉两种模式相结合的方式来实现的。推主要是基于redis的pub/sub机制,拉主要是基于消息队列和记录消费消息的偏移量来实现的。

https://github.com/xiaolyuh/layering-cache

作者信息

捐赠

项目的发展离不开你的支持,请作者喝杯咖啡吧!

微信-支付宝

技术支持

捐赠100元以上的用户可享有需求优先解决、协助部署、二次开发帮助。

微信

spring-boot-student

spring-boot-student-banner

spring-boot-student-config

  • Spring 安全配置@ConfigurationProperties的使用
  • 自定义properties并使用@PropertySource注解引入配置文件,使用@Value获取属性值
  • 通过@ImportResource注解引入XML配置

Spring Boot 核心-外部配置

spring-boot-student-log

  • Spring Boot日志配置
  • Spring Boot 使用XML配置日志
  • Spring Boot 切换日志框架
  • logback配置异步日志
  • Logback 快速定位用户在一次请求中的所有日志

Spring Boot 日志配置

Logback 快速定位用户在一次请求中的所有日志

spring-boot-student-profile

  • Spring Boot Profile配置

Spring Boot Profile 配置

spring-boot-student-data-jpa

  • Spring boot 和Spring data jpa配置
  • DBCP2连接池配置
  • Spring Boot连接池分析
  • Spring MVC Test(测试Controller)

Spring Boot+Spring Data Jpa+DBCP2数据源

dbcp2数据源配置详解

Spring Boot中Datasource配置分析

Spring MVC 测试

spring-boot-student-mybatis

  • Spring boot集成Mybatis和PageHPagehelper分页
  • Mybatis一级缓存分析
  • Mybatis二级缓存分析
  • Mybatis自带二级缓存的配置
  • Mysql查询的执行过程

Spring Boot+Mybatis+Pagehelper分页

MySQL查询的执行过程

《深入理解mybatis原理》 Mybatis数据源与连接池

MyBatis的一级缓存实现详解

MyBatis的二级缓存实现详解

MyBatis缓存机制的设计与实现

spring-boot-student-mybatis-ehcache

  • Spring Boot集成Mybatis
  • 使用ehcache作为Mybatis的二级缓存

Spring Boot + Mybatis + Ehcache 二级缓存实例

Spring Boot + Mybatis + 二级缓存实例(Ehcache,Redis)

spring-boot-student-mybatis-redis

  • Spring Boot集成Mybatis
  • 使用Redis作为Mybatis的二级缓存
  • 通过实现ApplicationContextAware接口获取Spring容器,并获取容器中的Bean

Spring Boot + Mybatis + Redis二级缓存实例

Spring Boot + Mybatis + 二级缓存实例(Ehcache,Redis)

spring-boot-student-mybatis-druid 自己定制

  • Druid简介
  • Druid数据源配置
  • Druid监控的配置
  • Spring Boot与Druid集成

Druid简介(Spring Boot + Mybatis + Druid数据源)

maven替换**仓库- 阿里云

spring-boot-student-mybatis-druid-2

  • Spring Boot 使用druid连接池连接数据库(官方start)

Druid简介(Spring Boot + Mybatis + Druid数据源【官方start】)

spring-boot-student-encode

  • AES,MD5,SHA1加密算法

加密算法 AES MD5 SHA1

spring-boot-student-data-jpa-transaction

  • 开启事务
  • Spring 事务类型
  • Spring 事务原理
  • Spring 事务的实现方式
  • Spring 事务的注意事项

Spring Boot Spring事务管理

Spring Boot AOP代理

spring-boot-student-cache

  • 缓存的简介
  • Spring对缓存支持
  • 开启声名式缓存支持
  • 声名式缓存注解
  • Spring Boot的支持

Spring Boot 数据缓存 Cache

Spring Boot缓存实战 默认Cache(ConcurrentMapCacheManager)

spring-boot-student-cache-ehcache

  • Spring Boot 使用 ehcache作为 Spring 缓存

Spring Boot缓存实战 EhCache

spring-boot-student-cache-redis

  • Spring Boot缓存实战 Redis
  • Spring Boot 使用 redis作为 Spring 缓存(自动刷新缓存)
  • 自动刷新缓存
  • redis key、value的序列化
  • java反射
  • 线程池

Spring Boot缓存实战 Redis

Spring Boot Cache + redis 设置有效时间和自动刷新缓存,时间支持在配置文件中配置

Redis 序列化方式StringRedisSerializer、FastJsonRedisSerializer

Spring Redis Cache @Cacheable 大并发下返回null

spring-boot-student-cache-caffeine

  • Spring Boot 使用 caffeine作为 Spring 缓存
  • caffeine 简介

Caffeine 缓存

Spring Boot 与 Caffeine的集成

spring-boot-student-cache-redis-caffeine

  • 基于redis + caffeine实现的多级缓存

Redis 序列化方式StringRedisSerializer、FastJsonRedisSerializer和KryoRedisSerializer

Spring Boot缓存实战 Redis + Caffeine 实现多级缓存

spring-boot-student-data-mongo

  • Spring Boot 使用Spring data mongo 操作mongodb数据库

spring-boot-student-data-redis

  • Spring Boot 使用Spring data redis 操作redis数据库

spring-boot-student-data-redis-distributed-lock

  • 基于redis实现的分布式锁
  • 分布式锁的实现方案

基于 redis 实现的分布式锁(一)

基于 redis 实现的分布式锁(二)

spring-boot-student-drools

spring-boot-student-stock-redis

spring-boot-student-rabbitmq

spring-boot-student-monitor

spring-boot-student-validated

spring-boot-student-guava-retrying

spring-boot-student-spring-retry

spring-boot-student-completable-future

spring-boot-student's People

Contributors

xiaolyuh123 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

spring-boot-student's Issues

CustomizedRedisCacheManager 父类cacheMap字段和父类updateCacheNames方法不存在?

您好,我没跑起来看,但是看了下您的代码,发现CustomizedRedisCacheManager 这个类里面定义了四个常量,是用来在合适的时机反射父类,获取父类(RedisCacheManager)属性和方法的,但是发现,cacheMap属性和updateCacheNames这个方法,在父类乃至祖类 都是不存在的,是因为版本问题么?也不对啊,刚从git上拉下来的, 版本是完全跟着您定义的版本号走的,难道之前是老版本,后来因为其他模块改成了新版本,而忽略了此处的反射方法的问题?

CustomizedRedisCache依然存在大并发下返回null的问题

public RedisCacheElement get(final RedisCacheKey cacheKey) {

        Assert.notNull(cacheKey, "CacheKey must not be null!");

        // 根据key获取缓存值
        RedisCacheElement redisCacheElement = new RedisCacheElement(cacheKey, fromStoreValue(lookup(cacheKey)));
        // 判断key是否存在
        Boolean exists = (Boolean) redisOperations.execute(new RedisCallback<Boolean>() {

            @Override
            public Boolean doInRedis(RedisConnection connection) throws DataAccessException {
                return connection.exists(cacheKey.getKeyBytes());
            }
        });

        if (!exists.booleanValue()) {
            return null;
        }

        return redisCacheElement;
    }

此处先获取redis的缓存,再判断redis中是否存在缓存key。存在第一步redis获取的缓存为null,此时其他机器向redis缓存数据,然后第二步判断key存在,导致返回了一个value为null的RedisCacheElement对象。

实测确实发生了这种情况。 我觉得判断部分应该修改为

 if (!exists.booleanValue() || redisCacheElement.get() == null) {
        return null;
}

return redisCacheElement;

但是我很奇怪,为什么源码不直接判断redisCacheElement.get()不为null的时候就返回RedisCacheElement对象,却用判断redis是否存在key的方法。

rabbitmq失败没有进行重发

将rabbitmq exchange test-send-award-exchange删掉,调用send,输出日志
MQ消息发送失败,消息重发,消息ID:a75b5579-1c9a-4908-929b-1a02af1a487b,重发次数:0,消息体:{"age":20,"id":1,"name":"12"}
但是没有进一步重发

spring-boot-student-layering-cache pom.xml layering-cache-aspectj jar包依赖问题

   <dependency>
        <groupId>com.xiaolyuh</groupId>
        <artifactId>layering-cache-aspectj</artifactId>
        <version>1.0.0</version>
    </dependency>

this jar can`t downloaded

Failed to execute goal on project spring-boot-student-layering-cache: Could not resolve dependencies for project com.xiaolyuh:spring-boot-student-layering-cache:jar:0.0.1-SNAPSHOT: Could not find artifact com.xiaolyuh:layering-cache-aspectj:jar:1.0.0 in alimaven (http://maven.aliyun.com/nexus/content/groups/public/) -> [Help 1]

so where is the places to download this jar ?

spring-boot-student-rabbitmq的confirm方法

ack为false时,消息重发,
this.convertAndSend(correlationData.getExchange(), correlationData.getRoutingKey(),
correlationData.getMessage(), correlationData);
实际上
image
没有再次重新发送,是不是我的操作有问题,请指教,谢谢

expireTime 单位错了

  • @param expireTime 锁的过期时间(单位:秒)

// 分布式服务器有时差,这里给1秒的误差值
expires = System.currentTimeMillis() + expireTime + 1;
应该改为:
expires = System.currentTimeMillis() + expireTime * 1000 + 1*1000;
因为currentTimeMillis单位是毫秒,但你l输入参数定义的expireTime是秒的

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.