zoukankan      html  css  js  c++  java
  • Hystrix支付测服务降级fallback

    1.pom文件

     

    <groupId>org.springframework.cloud</groupId>
    <artifactId>spring-cloud-starter-netflix-hystrix</artifactId>

    2.YML文件

     

    server:
    port: 8001
    spring:
    application:
    name: cloud-provider-hystrix-payment #服务名
    eureka:
    client:
    #表示是否将自己注册进EurekaServer默认为true
    register-with-eureka: true
    #是否从EurekaServer抓取已有的注册信息,默认为true,单节点无所谓,集群必须设置为true才能配合ribbon使用负载均衡
    fetch-registry: true
    service-url:
    defaultZone: http://eureka7001.com:7001/eureka,http://eureka7002.com:7002/eureka #集群版
    #defaultZone: http://localhost:7001/eureka 单机版

    3. 启动类

     

    @SpringBootApplication
    @EnableEurekaClient
    @EnableCircuitBreaker
    public class PaymentMainHystrix8001 {
    public static void main(String[] args) {
    SpringApplication.run(PaymentMainHystrix8001.class,args);
    }
    }

    4,业务类

     

    5. 控制层



    5. 控制层

  • 相关阅读:
    Python 函数与函数式编程
    Python 字符编码与转码
    Python 读写txt文件操作
    两阶段事务总结
    MPPDB集群高可用设计
    MPPDB中的各个组件
    IntelliJ IDEA2016学习小结
    mysql免安装版配置
    理想的智能机
    java对象的大小
  • 原文地址:https://www.cnblogs.com/fuqiang-zhou/p/12612213.html
Copyright © 2011-2022 走看看