![](https://img-blog.csdnimg.cn/20201014180756724.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
spring
songling515010475
这个作者很懒,什么都没留下…
展开
-
Springboot 2.1.6 pom文件第一行报错
用eclipse生成springboot报错,原因是springboot版本问题。 解决办法:在properties属性中新增<maven-jar-plugin.version>3.1.1</maven-jar-plugin.version>,或者把springboot下降一个版本,我试过2.0.4 就没这个问题 <properties> <...原创 2019-07-18 09:18:31 · 1438 阅读 · 0 评论 -
spring-cloud服务请求信号量隔离之hystrix
1、创建一个maven项目hystrix-ribbon-semaphore-consumer pom.xml <dependency> <groupId>junit</groupId> <artifactId>junit</artifactId> <version>3.8.1</versi...原创 2019-08-08 11:40:01 · 1613 阅读 · 0 评论 -
spring-cloud服务请求线程隔离之hystrix
1、创建一个maven项目hystrix-ribbon-threadpool-consumer pom.xml <dependency> <groupId>junit</groupId> <artifactId>junit</artifactId> <version>3.8.1</version> ...原创 2019-08-08 10:46:15 · 363 阅读 · 0 评论 -
spring-cloud服务请求熔断之hystrix
1、创建一个maven项目hystrix-ribbon-breaker-consumer pom.xml <dependency> <groupId>junit</groupId> <artifactId>junit</artifactId> <version>3.8.1</versio...原创 2019-08-08 09:41:06 · 161 阅读 · 0 评论 -
springboot-eureka完整Demo
一、单机版 准备工作,创建一个父项目,三个子项目,分别如下 ymSpringboot-eureka-demo eureka-service 服务端 eureka-provider 提供者 eureka-consumer消费者 1、ymSpringboot-eureka-demo 父项目pom.xml主要配置 <project xmlns="http://maven.a...原创 2019-07-22 16:47:27 · 900 阅读 · 0 评论 -
springboot-zuul配置
1、创建一个工程名为 zuul-gateway的maven工程,在pom.xml中引入依赖(因为后面会涉及到eureka,所以这里也一起加进去) <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-web</ar...原创 2019-07-24 17:51:12 · 1453 阅读 · 0 评论 -
spring-cloud服务请求合并之hystrix
1、创建一个maven项目hystrix-ribbon-batch-consumer pom.xml <dependency> <groupId>junit</groupId> <artifactId>junit</artifactId> <version>3.8.1</version&...原创 2019-08-02 17:56:50 · 149 阅读 · 0 评论 -
spring-cloud服务请求缓存之hystrix
1、这里只演示缓存,就用一个项目测试,创建一个hystrix-ribbon-cache-consumer的maven项目 pom.xml <dependency> <groupId>junit</groupId> <artifactId>junit</artifactId> <version>3.8.1</v...原创 2019-08-02 15:57:00 · 145 阅读 · 0 评论 -
spring-cloud 2.X 声明式服务 feign(openfeign)基本配置
准备工作 ,三个工程如下: feign-api feign-core feign-consumer 一、feign-api创建 1、引入依赖 <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-web</...原创 2019-07-29 17:51:30 · 1953 阅读 · 0 评论 -
springboot-admin监控环境搭建
1、创建两个项目来做测试,ymSpringBoot-admin-service 和ymSpringBoot-admin-client 两个工程,在下面说明中会简称service 和 client 配置服务端 2、在service项目的pom.xml中加入入依赖 <dependency> <groupId>de.codecentric<...原创 2019-07-18 17:55:40 · 279 阅读 · 0 评论 -
SpringBoot 自定义异常
1、创建一个类,继承要捕获的异常 package com.ym.springboot.exception; @SuppressWarnings("serial") public class BusinessException extends RuntimeException{ private String code; private String msg; public Bus...原创 2019-07-18 11:53:31 · 164 阅读 · 0 评论 -
springboot 常用核心注解说明
1、 @SpringBootApplication @SpringBootConfiguration @Configuration #3.X引入的标签,用来代替XML的Bean @EnableAutoConfiguration #自动加载jar配置 @ComponentScan #代替 <context:component-scan> 扫...原创 2019-07-18 11:21:41 · 337 阅读 · 0 评论 -
springboot 多环境配置 --spring.profiles.active
1、修改配置文件,配置文件格式为 application-{XXX}.yml 并且两件配置文件端口不能冲突,我这里测试(test)环境用的是9090,开发(dev)环境用的是8080 2、在pom文件中加入如下配置,否则运行时会提示找为到主清单 在pom中新增如下配置 <build> <plugins> <plugin> <...原创 2019-07-18 10:27:05 · 5237 阅读 · 0 评论 -
spring-cloud服务降级之hystrix
1、在这里准备两个maven项目如下 eureka-provider hystrix-ribbon-fallback-consumer 2、 eureka-provider 下的 pom.xm配置 <dependency> <groupId>junit</groupId> <artifactId>junit</artif...原创 2019-08-02 14:27:39 · 101 阅读 · 0 评论