随笔分类 -  SpringBoot And SpringCloud

摘要:Spring Boot实战:拦截器与过滤器 一、拦截器与过滤器 在讲Spring boot之前,我们先了解一下过滤器和拦截器。这两者在功能方面很类似,但是在具体技术实现方面,差距还是比较大的。在分析两者的区别之前,我们先理解一下AOP的概念,AOP不是一种具体的技术,而是一种编程思想。在面向对象编程 阅读全文
posted @ 2019-07-16 18:24 甜菜波波 阅读(3483) 评论(0) 推荐(0) 编辑
摘要:Spring的事务经常会有这样的配置: 1 <tx:method name="search*" read-only="true" /> 或者这样的注记: 1 @Transactional(readOnly = true) 正好我正在做的项目中这样配置了,而且偶然发现配置了不生效,本着“不弄明白对不起 阅读全文
posted @ 2019-01-03 11:02 甜菜波波 阅读(3593) 评论(0) 推荐(1) 编辑
摘要:Spring事务传播行为:spring特有的事务传播行为,spring支持7种事务传播行为,确定客户端和被调用端的事务边界(说得通俗一点就是多个具有事务控制的service的相互调用时所形成的复杂的事务边界控制)下图所示为7钟事务传播机制o 传播行为 含义PROPAGATION_REQUIRED(X 阅读全文
posted @ 2018-11-07 11:18 甜菜波波 阅读(414) 评论(0) 推荐(0) 编辑
摘要:1.start.sh 3.stop.sh backup.sh 阅读全文
posted @ 2018-10-26 17:28 甜菜波波 阅读(581) 评论(0) 推荐(0) 编辑
摘要:SpringBoot 自动配置主要通过 @EnableAutoConfiguration, @Conditional, @EnableConfigurationProperties 或者 @ConfigurationProperties 等几个注解来进行自动配置完成的。 @EnableAutoCon 阅读全文
posted @ 2018-10-25 15:23 甜菜波波 阅读(832) 评论(0) 推荐(0) 编辑
摘要:1.pom.xml <?xml version="1.0" encoding="UTF-8"?> <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instan 阅读全文
posted @ 2018-09-04 15:30 甜菜波波 阅读(448) 评论(1) 推荐(0) 编辑
摘要:SpringCloud重试机制配置 首先声明一点,这里的重试并不是报错以后的重试,而是负载均衡客户端发现远程请求实例不可到达后,去重试其他实例。 ? 1 2 3 4 5 6 7 8 @Bean @LoadBalanced RestTemplate restTemplate() { HttpCompo 阅读全文
posted @ 2018-09-04 13:48 甜菜波波 阅读(857) 评论(0) 推荐(1) 编辑
摘要:1.引入依赖 阅读全文
posted @ 2018-09-04 10:36 甜菜波波 阅读(346) 评论(0) 推荐(0) 编辑
摘要:Spring Cloud实现心跳监测,在服务注册和停止时,注册中心能得到通知,并更新服务实例列表 Spring Cloud注册中心添加配置: eureka.server.enable-self-preservation=false Spring Cloud服务提供者添加配置: eureka.inst 阅读全文
posted @ 2018-09-03 22:38 甜菜波波 阅读(2910) 评论(0) 推荐(0) 编辑
摘要:package com.example.demo; import com.netflix.hystrix.contrib.javanica.annotation.HystrixCommand; import com.netflix.hystrix.contrib.javanica.annotation.HystrixProperty; import org.springframework.we... 阅读全文
posted @ 2018-09-03 14:47 甜菜波波 阅读(249) 评论(0) 推荐(0) 编辑
摘要:DubboSpring Cloud 服务注册中心 Zookeeper Spring Cloud Netflix Eureka 服务调用方式 RPC REST API 服务网关 无 Spring Cloud Netflix Zuul 断路器 不完善 Spring Cloud Netflix Hystr 阅读全文
posted @ 2018-08-30 16:48 甜菜波波 阅读(157) 评论(0) 推荐(0) 编辑
摘要:转载自:https://segmentfault.com/a/1190000005988895 http://blog.csdn.net/xiaoyu411502/article/details/50601687 Netflix的 Hystrix 是一个帮助解决分布式系统交互时超时处理和容错的类库, 阅读全文
posted @ 2018-08-20 16:04 甜菜波波 阅读(9687) 评论(0) 推荐(0) 编辑
摘要:目录(?)[-] 1 依赖引入 2 使用 21 Hystrix command 211 同步执行 212 异步执行 213 反应执行 214 三种模式使用区别 22 Fallback 23 Error Propagation 24 Configuration 1. 依赖引入 pom.xml <pro 阅读全文
posted @ 2018-08-20 15:39 甜菜波波 阅读(1890) 评论(0) 推荐(0) 编辑
摘要:<build> <plugins> <plugin> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-maven-plugin</artifactId> </plugin> </plugins></build>然 阅读全文
posted @ 2018-07-01 09:55 甜菜波波 阅读(155) 评论(0) 推荐(0) 编辑
摘要:<build> <plugins> <plugin> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-maven-plugin</artifactId> </plugin> </plugins></build> 阅读全文
posted @ 2018-06-04 11:59 甜菜波波 阅读(346) 评论(0) 推荐(0) 编辑
摘要:1.application.propertites 2.启动代码 阅读全文
posted @ 2018-06-03 11:21 甜菜波波 阅读(254) 评论(0) 推荐(0) 编辑
摘要:第 5 章 Docker + Spring Boot: 快速搭建和部署Java Web应用 0、你需要: JDK 1.8 : java -version Maven 3.0+ : mvn -v Git : git --version Source Code : https://github.com/ 阅读全文
posted @ 2018-06-02 17:57 甜菜波波 阅读(192) 评论(0) 推荐(0) 编辑
摘要:说在前面 这里日志分两种。一种是tomcat的输出(系统)日志,一种是自己定义的日志。 系统日志设置 目标 当springboot接收到请求时记录日志到文件中 实现 你只需要在你的绿叶application.properties配置文件中加入一下的配置 1 2 3 4 效果 它就会自动在D:/log 阅读全文
posted @ 2018-06-01 15:36 甜菜波波 阅读(356) 评论(0) 推荐(0) 编辑
摘要:1.引入quzrtz 2.新建1个类,模拟定时任务 ScheduledJob.java 3.新建类MyScheduler 3.添加SchedulerListener.java,必须有@Configuration注解 阅读全文
posted @ 2018-06-01 13:31 甜菜波波 阅读(2620) 评论(0) 推荐(0) 编辑
摘要:à SpringBoot视频 http://study.163.com/course/introduction.htm?courseId=1004329008&utm_campaign=commission&utm_source=400000000155061&utm_medium=share à  阅读全文
posted @ 2018-05-31 15:47 甜菜波波 阅读(768) 评论(0) 推荐(0) 编辑

点击右上角即可分享
微信分享提示