掌握系列之微服务-2.SpringCloud
掌握高并发、高可用架构第四章 微服务
本章介绍微服务的概念、为何要引入微服务、微服务会引发的问题,以及流行的微服务架构等。
第二节 SpringCloudSpringBoot
SpringCloud
是Spring组件一站式解决方案,主要是简化了使用Spring的难度,减省了繁重的配置,提供了各种启动器,使得开发者快速上手
主要有三个注解:
@SpringBootConfiguration,实现了配置文件的功能@EnableAutoConfiguration,开启自动配置@ComponentScan,组件扫描各种启动器:
spring-boot-starter-webspring-boot-starter-jdbcspring-boot-starter-jpaspring-boot-starter-securityspring-boot-starter-actuator,监控和跟踪的功能spring-boot-starter-logging,使用logback进行日志记录spring-boot-starter-cacheSpring Cloud分布式注册中心-Eureka
@EnableEurekaServer
@EnableDiscoveryClient
服务调用-Feign
@FeignClient(servername)
本地负载均衡-Ribbon
@LoadBalanced
服务断路器、降级、隔离-Hystrix
@HystrixCommand(fallback=method)
网关Zuul
@EnableZuulProxy
配置中心-SpringCloud Config
消息总线-Bus声明:本站所有文章资源内容,如无特殊说明或标注,均为采集网络资源。如若本站内容侵犯了原著者的合法权益,可联系本站删除。