随笔分类 -  Java框架

摘要:1.单application yml > properties 当前项目的根目录/config/ 【jar包内config目录下】 # 最高优先级 当前项目的根目录/ 【jar包内】 # 第二优先级 类路径(在resources目录下)/config/ 【classpath路径下,即jar包所在目录 阅读全文
posted @ 2024-04-04 22:02 lwx_R 阅读(93) 评论(0) 推荐(0)
摘要:1.配置文件 spring: datasource: food: type: com.alibaba.druid.pool.DruidDataSource driver-class-name: com.mysql.cj.jdbc.Driver jdbc-url: jdbc:mysql://43.13 阅读全文
posted @ 2024-04-04 19:10 lwx_R 阅读(42) 评论(0) 推荐(0)
摘要:https://www.xuxueli.com/xxl-job/#%E3%80%8A%E5%88%86%E5%B8%83%E5%BC%8F%E4%BB%BB%E5%8A%A1%E8%B0%83%E5%BA%A6%E5%B9%B3%E5%8F%B0XXL-JOB%E3%80%8B 1.调度中心 运行调 阅读全文
posted @ 2024-04-04 16:11 lwx_R 阅读(26) 评论(0) 推荐(0)
摘要:1.公共mapper.xml 其他模块的配置 mybatis: mapper-locations: classpath*:org/example/common/web/mappers/*.xml typeAliasesPackage: org.example.common.web.domain # 阅读全文
posted @ 2024-04-03 23:12 lwx_R 阅读(38) 评论(0) 推荐(0)
摘要:@Scheduled(cron = "0 0 */3 * * ?")//定时任务注解 public void fun() { } 阅读全文
posted @ 2023-12-31 01:36 lwx_R 阅读(34) 评论(0) 推荐(0)
摘要:1.依赖 <!--状态机--> <dependency> <groupId>org.springframework.statemachine</groupId> <artifactId>spring-statemachine-core</artifactId> <version>2.0.1.RELE 阅读全文
posted @ 2023-12-14 11:05 lwx_R 阅读(158) 评论(0) 推荐(0)
摘要:1.@RequestParam Content-Type: application/x-www-form-urlencoded 一般是form直接发送请求 postman 使用form-data来传值 2.@RequestBody contentType: "application/json; ch 阅读全文
posted @ 2023-10-10 23:50 lwx_R 阅读(22) 评论(0) 推荐(0)
摘要:1.父模块 <parent> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-parent</artifactId> <version>3.0.5</version> </parent> <pro 阅读全文
posted @ 2023-10-05 20:08 lwx_R 阅读(87) 评论(0) 推荐(0)
摘要:1.动态SQL Mybatis提供的拼接Sql语句的机制。 1.if <select id="listSearchStudents" resultType="entity.Student"> select * from stu where sname = #{sname} <if test="pho 阅读全文
posted @ 2023-10-04 18:00 lwx_R 阅读(24) 评论(0) 推荐(0)
摘要:Java17以上 1.依赖 <parent> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-parent</artifactId> <version>3.0.0</version> <relat 阅读全文
posted @ 2023-10-04 17:45 lwx_R 阅读(130) 评论(0) 推荐(0)
摘要:## 1.依赖 - 父工程 ```xml org.springframework.boot spring-boot-starter-parent 2.2.4.RELEASE org.springframework.cloud spring-cloud-dependencies Hoxton.SR1 阅读全文
posted @ 2023-08-14 21:41 lwx_R 阅读(24) 评论(0) 推荐(0)
摘要:- 自动将下划线命名格式转化为驼峰 阅读全文
posted @ 2023-08-10 00:20 lwx_R 阅读(13) 评论(0) 推荐(0)
摘要:## 1.什么是微服务 微服务架构是一个分布式系统, 按照业务进行划分成为不同的服务单元, 解决单体系统性能等不足。 微服务是一种架构风格,一个大型软件应用由多个服务单元组成。系统中的服务单元可以单独部署,各个服务单元之间是松耦合的。 ## 2.微服务之间通信 - Rest Http协议 RestT 阅读全文
posted @ 2023-08-05 18:36 lwx_R 阅读(85) 评论(0) 推荐(0)
摘要:## 1.下载安装包解压 ## 2.mysql配置 #### 2.1 启动binlog功能 - 查看是否启动 ``` show variables like 'binlog_format%' ``` - 修改my.cnf配置 ``` log-bin=mysql-bin #添加这一行就 ok binl 阅读全文
posted @ 2023-07-18 20:25 lwx_R 阅读(202) 评论(0) 推荐(0)
摘要:## 1.下载安装包解压 ## 2.修改配置文件 - 新建data,log文件夹 - 修改conf/zoo.cfg ``` dataDir=D:\Code\ZooKeeper\zookeeper-3.4.11\data dataLogDir=D:\Code\ZooKeeper\zookeeper-3 阅读全文
posted @ 2023-07-18 20:15 lwx_R 阅读(12) 评论(0) 推荐(0)
摘要:## 1.什么是配置中心 在微服务架构中,当系统从一个单体应用,被拆分成分布式系统上一个个服务节后,配置文件也必须跟着迁移(分割) ,这样配置就分散了,不仅如此,分散中还包含着冗余,如下图: 配置中心将配置从各应用中剥离出来,对配置进行统一管理,应用自身不需要自身去管理配置 ![](https:// 阅读全文
posted @ 2023-07-06 21:27 lwx_R 阅读(74) 评论(0) 推荐(0)
摘要:## 1.Spring Cloud Gateway Spring Cloud Gateway作为Spring Cloud生态系统中的网关,目标是替代Netflix Zuul 其不仅提供统一的路由方式,并且还基于Filter链的方式提供了网关基本的功能。 目前最新版Spring Cloud中引用的还是 阅读全文
posted @ 2023-07-04 10:53 lwx_R 阅读(90) 评论(0) 推荐(0)
摘要:## 1.概念 随着微服务的流行,服务和服务之间的稳定性变得越来越重要。Sentinel 以流量为切入点,从流量控制、熔断降级、系统负载保护等多个维度保护服务的稳定性。 Sentinel具有以下特征: - 丰富的应用场景: Sentinel承接了阿里巴巴近10年的双十-大促流量的核心场景,例如秒杀( 阅读全文
posted @ 2023-07-01 15:27 lwx_R 阅读(45) 评论(0) 推荐(0)
摘要:## 1.概念 Hystrix 源自Netflix 团队于2011年开始研发。2012年 Hystrix不断发展和成熟,Netlix 内部的许多团队都采用了它。 如今,每天在Netlix上通过Hystrix执行数百亿个线程隔离和数千亿个信号量隔离的调用。极大地提高了系统的稳定性。 在分布式环境中,不 阅读全文
posted @ 2023-06-29 23:23 lwx_R 阅读(57) 评论(0) 推荐(0)
摘要:## 1.静态资源映射规则 #### 1.1 webjars SpringMVC的配置类WebMvcAutoConfiguration中addResourceHandlers添加资源处理 有一个webjars:以jar包的方式引入我们的静态资源 ```xml org.webjars jquery 3 阅读全文
posted @ 2023-06-29 17:39 lwx_R 阅读(35) 评论(0) 推荐(0)