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. 控制层

  • 相关阅读:
    BZOJ 1630/2023 Ant Counting 数蚂蚁
    BZOJ 3997 组合数学
    BZOJ 2200 道路与航线
    BZOJ 3181 BROJ
    BZOJ 4011 落忆枫音
    BZOJ 4027 兔子与樱花
    vijos 1741 观光公交
    vijos 1776 关押罪犯
    vijos 1780 开车旅行
    5、异步通知机制
  • 原文地址:https://www.cnblogs.com/fuqiang-zhou/p/12612213.html
Copyright © 2011-2022 走看看