首页 > 其他分享 >Hystrix

Hystrix

时间:2022-12-01 23:12:29浏览次数:51  
标签:registrationBean 缓存 hystrix stream Hystrix 请求

title: Hystrix
date: 2022-12-01 21:59:18
tags:

https://gitee.com/hslxy/spring-cloud-learning中的hystrix-service模块

这个工具可以实现服务降级、请求缓存、请求合并功能

服务降级

服务降级就是将服务进行隔离,避免因为当前服务的问题导致关联的服务也一起崩溃

请求缓存

就是将请求根据一定规则缓存起来,下次直接返回缓存

请求合并

就是当一定时间的内有多个相同请求时,将多个请求合并成一个请求

20221201220448

就比如这个我发了三个请求,结果1,2请求合并成了一个

监控工具 Hystrix Dashboard 是Spring Cloud中查看Hystrix实例执行情况的一种仪表盘组件

踩坑
Origin parameter: http://localhost:8401/actuator/hystrix.stream is not in the allowed list of proxy

hystrix:
  dashboard:
    proxy-stream-allow-list: "localhost"

踩坑
Failed opening connection to http://localhost:8401/actuator/hystrix.stream : 404 : HTTP/1.1 404
网上都说是这个,但是这个不是关键,*改成hystrix.stream,我都不行

management:
  endpoints:
    web:
      exposure:
        include: "*"

用下面这个
https://blog.csdn.net/weixin_43391312/article/details/105017927

在服务提供者的主函数中添加

	@Bean
	public ServletRegistrationBean getServlet(){
		HystrixMetricsStreamServlet streamServlet = new HystrixMetricsStreamServlet();
		ServletRegistrationBean registrationBean = new ServletRegistrationBean(streamServlet);
		registrationBean.setLoadOnStartup(1);
		registrationBean.addUrlMappings("/actuator/hystrix.stream");
		registrationBean.setName("HystrixMetricsStreamServlet");

		return registrationBean;
	}

turbine聚合hystrix的信息

标签:registrationBean,缓存,hystrix,stream,Hystrix,请求
From: https://www.cnblogs.com/hslxy/p/16943086.html

相关文章

  • SpringCloud(二) - Eureka注册中心,feign远程调用,hystrix降级和熔断
    1、项目模块介绍2、父项目主要依赖spring-cloud的版本控制<properties><!--springCloud版本--><scd.version>Dalston.SR4</scd.version></pro......
  • 【Spring Cloud实战】Hystrix断路器
    gitee地址:https://gitee.com/javaxiaobear/spring-cloud_study.git在线阅读地址:https://javaxiaobear.gitee.io/1、概述分布式面临的问题复杂分布式体系结构中的应用程序有......
  • SpringCloud学习八:Hystrix服务熔断、服务降级、Dashboard流监控
    文章目录​​一、概念:服务雪崩​​​​二、什么是Hystrix​​​​三、服务熔断​​​​概述​​​​实验​​​​第一步:创建服务提供者springcloud-provider-dept-hystrix-8......
  • SpringCloud-05 Hystrix学习笔记
    @[Toc]一、Hystrix简介1、Hystrix是什么?流量高峰时,一个单节点的宕机或延迟,会迅速导致所有服务负载达到饱和。应用中任何一个可能通过网络访问其他服务的节点,都有可能成为......
  • 微服务组件--限流框架Spring Cloud Hystrix分析
    Hystrix的介绍【1】Hystrix是springCloud的组件之一,Hystrix可以让我们在分布式系统中对服务间的调用进行控制加入一些调用延迟或者依赖故障的容错机制。【2】Hystrix通......
  • Hystrix配置参数解析
    HystrixCommand配置方式我们的配置都是基于HystrixCommand的,我们通过在方法上添加 @HystrixCommand 注解并配置注解的参数来实现配置,但有的时候一个类里面会有多个......
  • Spring Cloud:第四章:Hystrix断路器
    Hystrix“豪猪”,具有自我保护的能力。hystrix通过如下机制来解决雪崩效应问题。资源隔离:包括线程池隔离和信号量隔离,限制调用分布式服务的资源使用,某一个调用的服务出现......
  • SpringCloud 使用 Turbine 聚合监控 Hystrix 健康状态
    Hystrix的降级熔断只是被迫的折中方案,并不是我们所期望的结果,我们还是期望系统能够永远健康运行。绝大多数情况下,一个系统有很多微服务组成,高峰期很可能个别微服务会发生......
  • hystrix的基本使用
    一、降级(请求超时)引入依赖<!--放到调用者的pom.xml中--><dependency><groupId>org.springframework.cloud</groupId><artifactId>spring-cloud-starter-net......
  • [hystrix] hystrix-dashboard 关于 Unable to connect to Command Metric Stream 的问
    问题在hystrix-dashboard界面中出现以下错误解决方法高版本(具体哪些版本之后我不知道,加上去试试)springcloud需要加以下配置(在被监控一端):@Configurationpubli......