zoukankan      html  css  js  c++  java
  • 分布式微服务技术之 Spring Cloud Netflix

    1 背景

      Netflix 是全球十大视频网站中唯一收费站点,是美国互联网流媒体播放商,由于访问量巨大,转型为云计算公司。

      由Netflix公司主持开发了一套代码框架和库Netflix OSS即open source,后来合入spring cloud,即Spring Cloud Netflix,成为spring cloud中的一套框架。所以Spring Cloud Netflix是Netflix OSS基础之上的封装。

    2 Spring Cloud Netflix常见模式

      通过注释可以快速启用和配置应用程序中常见的模式,提供的模式包括服务发现eureka,断路器hystrix,智能路由zuul,客户端负载平衡ribbon。

    3 服务发现 eureka客户端

    3.1 如何包含eureka客户端

    配置pom依赖

       <groupId>spring-boot-starter</groupId>
       <artifactId>spring-boot-starter-web</artifactId>
       <groupId>spring-cloud-starter-eureka</groupId>
       <artifactId>spring-cloud-starter-eureka-feign</artifactId>
       <groupId>spring-cloud-starter-eureka</groupId>
       <artifactId>spring-cloud-starter-eureka-config</artifactId>

    注册eureka

    新建一个main方法,增加注解

    @SpringBootApplication

    @EnableDiscoveryClient

    @EnableFeignClients

    @EnableAsync

    若使用EnableDiscoveryClient也需要配置才能找到服务器,资源文件夹下yml文件配置eureka,如

    eureka

      client

         serviceUrl

             defaultZone:http://xxxx/eureka/

  • 相关阅读:
    LeetCode:387字符串中唯一出现一一次的字符
    LeetCode-79. 单词搜索
    LeetCode-75. 颜色分类
    LeetCode-121. 买卖股票的最佳时机
    LeetCode-58. 最后一个单词的长度
    LeetCode-1103. 分糖果 II
    LeetCode:283. 移动零
    LeetCode:38. 外观数列
    LeetCode:70. 爬楼梯
    获取美拍视频的链接--JS分析
  • 原文地址:https://www.cnblogs.com/guobm/p/10208254.html
Copyright © 2011-2022 走看看