我们都知道redis 也有发布订阅模式, 但是使用的比较少。 并且redis的发布订阅不会持久化落入磁盘。总的来说就是不可靠。 但是在一些场景我们还是会用到的。...这里我们就来springboot 整合一下redis 进行发布订阅。...具体代码 application,properties 的配置 # 默认选择零号数据库 spring.redis.database=0 spring.redis.host=127.0.0.1 spring.redis.port...好了,今天的springboot整合redis 消息的发布订阅就完成了。 这里有一个问题,就是新加入的订阅者不会消费之后的数据,也不支持动态的添加topicName , 就是发布者。
参考:https://www.yuque.com/leifengyang/springboot2 参考:https://www.bilibili.com/video/BV19K4y1L7MT?...serverTimezone=Asia/Shanghai spring.datasource.username=root spring.datasource.password=123456 spring.redis.host...=localhost spring.redis.port=6379 spring.redis.password=redis spring.redis.database=0 测试项目 5....配置文件 5.1 SpringBoot2核心技术-核心功能 5.2 文件类型 5.2.1 properties 同以前的properties用法 5.2.2 yaml YAML 是 "YAML Ain't
Springboot集成redis大家都会用,主要就是使用RedisTemplate类来进行各种操作。...可能很多人并没有注意,在Springboot2以后,底层访问redis已经不再是jedis了,而是lettuce。 至于jedis和lettuce有什么区别呢,对我们的使用有什么影响呢?...由此带来的问题时,如果线程数过多,带来redis server的负载加大。有点类似于BIO的模式。...在Springboot1.x时,我们配置redis是这样的: ? 那么现在使用了lettuce的情况下: ? 如果你感觉并不需要这个pool,把pool的配置给去掉就行了: ?...这在我的使用中,已经满足需求了,我都是将需要存入redis的对象变成json字符串存入。
# SpringBoot2 快速入门 # 系统要求 Java8&兼容Java14 Maven3.3及以上 idea 2019.1.2 # maven设置 ...HelloController { @RequestMapping("/hello") //映射请求 public String handle01(){ return "Hello,SpringBoot2
序 本文主要研究下springboot2的MappingsEndpoint MappingsEndpointAutoConfiguration spring-boot-actuator-autoconfigure...RouterFunctionMappingDescriptionProvider、UrlHandlerMappingDescriptionProvider这三个来获取HandlerMappingDescriptionProvider 小结 springboot2
序 本文主要研究下springboot2的LoggersEndpoint 实例 GET /actuator/loggers { "levels": [ "OFF", "ERROR", "WARN
1、系统要求 Java 8 & 兼容java14 . Maven 3.3+ idea(最好2019版本以上) 1.1、maven设置 <mirrors> ...
依赖 <dependency> <groupId>org.springframework.kafka</groupId> <artifactId>s...
# SpringBoot2 常用注解 @SpringBootApplication @EnableAutoConfiguration @ImportResource @Value @ConfigurationProperties
springboot2增加diskspace指标 聊聊springboot2的ScheduledTasksEndpoint 聊聊springboot2的httptrace springboot2自定义...HttpTraceRepository 聊聊springboot2的embeded container的配置改动 springboot2自定义statsd指标前缀 springboot2上报metrics...聊聊spring-boot-starter-data-redis的配置变更 redis的bitset实战 redis的HyperLogLog实战 redis的GEO实战 RedisTemplate读取...slowlog 聊聊redis的HealthIndicator 聊聊lettuce的指标监控 redis的sentinel模式故障演练 聊聊lettuce的sentinel连接 聊聊spring-data-redis...的slowlog与latency monitor 聊聊redis的事务操作 聊聊redis的数据结构的应用 聊聊redisson的分布式锁 聊聊redisson的DelayedQueue 聊聊redis
SpringBoot引入Swagger的maven库之前,需要先引入springboot-web的maven,否则没有效果。
序 本文主要研究下springboot2的httptrace HttpTraceAutoConfiguration spring-boot-actuator-autoconfigure-2.0.1.RELEASE-sources.jar
版权声明:本文为博主原创文章,未经博主允许不得转载。 本例实现方法 ApplicationRunner @Component @Order(10...
开发环境:idea2018、springboot2.0.5 1、 POM添加微信开发支持 <parent> <groupId>org.springframe...
序 本文主要研究下如何在springboot2新增一个diskspace指标 disk health indicator DiskSpaceHealthIndicatorProperties spring-boot-actuator-autoconfigure...measurements": [ { "statistic": "VALUE", "value": 96.99886102691765 } ], "availableTags": [] } 小结 springboot2
序 本文主要研究下springboot2的ScheduledTasksEndpoint 实例 注解形式 @Component public class ScheduleTask { @Scheduled
3、MyChannelHandlerPool.java类,channelHandler设置。
序 本文主要研究下springboot2的micrometer micrometer springboot2在spring-boot-actuator中引入了micrometer,对1.x的metrics...Prometheus springboot2启用/actuator/prometheus端点,供Prometheus来抓取指标。...小结 springboot2的micrometer支持了tag/label,配合支持tag/label的监控系统,使得我们可以更加方便地对metrics进行多维度的统计查询及监控。
序 本文主要研究一下如何将springboot2的metrics输出到influxdb maven org.springframework.boot...http.server.requests\"" { "results": [ { "statement_id": 0 } ] } 小结 springboot2
修订时间 修订内容 2019-03 SpringBoot2集成Druid配置v2,新增druid-spring-boot-starter部分,简化操作 2020-03 新增Druid JAVA Config
领取专属 10元无门槛券
手把手带您无忧上云