Hystrix 仪表板卡在加载屏幕上

2024-03-11

我在 localhost:8988/hystrix 上运行 Hystrix 仪表板,我想监视 OrderService 和 ProductService 之间的请求。端点“hystrix.stream”已经注册,并且 hystrix 仪表板停留在加载状态,没有任何结果。

这是调用我想要监控的产品服务的服务客户端:

@Service
public class ProductServiceClient {
    private final RestTemplate restTemplate;
    public ProductServiceClient(RestTemplate restTemplate) {
        this.restTemplate = restTemplate;
    }
    @HystrixCommand(fallbackMethod = "getDefaultProductById")
    public Optional<ProductDto> getProductById(Long productId) {
        ResponseEntity<ProductDto> productResponse = restTemplate
                .getForEntity("http://product-service/api/product/{id}",
                        ProductDto.class,
                        productId);
        if (productResponse.getStatusCode() == HttpStatus.OK) {
            return Optional.ofNullable(productResponse.getBody());
        } else {
            log.error("Unable to get product with ID: " + productId
                    + ", StatusCode: " + productResponse.getStatusCode());
            return Optional.empty();
        }
    }
    Optional<ProductDto> getDefaultProductById(String productId) {
            log.info("Returning default ProductById for product Id: " + productId);
        ProductDto productDto = new ProductDto();
        productDto.setId(productId);
        productDto.setName("UNKNOWN");
        productDto.setDescription("NONE");
        return Optional.ofNullable(productDto);
    }
}

我将 @EnableCircuitBreaker 注释添加到主类中,并使用这些依赖项:

        <dependency>
            <groupId>org.springframework.cloud</groupId>
            <artifactId>spring-cloud-starter-config</artifactId>
            <version>2.1.1.RELEASE</version>
        </dependency>
        <dependency>
            <groupId>org.springframework.cloud</groupId>
            <artifactId>spring-cloud-starter-netflix-eureka-client</artifactId>
            <version>2.1.1.RELEASE</version>
        </dependency>
        <dependency>
            <groupId>org.springframework.cloud</groupId>
            <artifactId>spring-cloud-starter-netflix-hystrix</artifactId>
            <version>2.1.1.RELEASE</version>
        </dependency>
        <dependency>
            <groupId>org.springframework.cloud</groupId>
            <artifactId>spring-cloud-starter-openfeign</artifactId>
            <version>2.1.1.RELEASE</version>
        </dependency>
        <dependency>
            <groupId>org.springframework.cloud</groupId>
            <artifactId>spring-cloud-starter-sleuth</artifactId>
            <version>2.1.1.RELEASE</version>
        </dependency>
        <dependency>
            <groupId>org.springframework.cloud</groupId>
            <artifactId>spring-cloud-starter-zipkin</artifactId>
            <version>2.1.1.RELEASE</version>
        </dependency>


Issue

就我而言,将 spring-cloud 升级到Hoxton.SR6.

在浏览器控制台中,出现以下错误:

未捕获的类型错误:e.indexOf 不是函数

这似乎是jquery版本问题。


Solution

将 spring-cloud 版本降级为Hoxton.SR4,那么错误就消失了。

因此,您可能需要检查浏览器的控制台输出以查看是否存在错误。


Tips

  • 另一个可能的原因是您没有访问应用程序的 api,该 api 标记为@HystrixCommand yet.
    在这种情况下,调用 api,仪表板就会显示图表。
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)

Hystrix 仪表板卡在加载屏幕上 的相关文章

  • SpringCloud(八)Hystrix断路器

    文章目录 1 概述分布式系统面临的问题是什么能干嘛官网资料Hystrix官宣 xff0c 停更进维 2 Hystrix重要概念3 hystrix案例构建项目高并发测试故障现象和导致原因上诉结论如何解决 xff1f 解决的要求服务降级服务熔断
  • 客户端负载均衡Feign之四:Feign配置

    Ribbon配置 在Feign中配置Ribbon非常简单 直接在application properties中配置即可 如 设置连接超时时间 ribbon ConnectTimeout 500 设置读取超时时间 ribbon ReadTim
  • Hystrix使用说明,配置参数说明

    一 什么情况下会触发fallback方法 名字 描述 触发fallback EMIT 值传递 NO SUCCESS 执行完成 没有错误 NO FAILURE 执行抛出异常 YES TIMEOUT 执行开始 但没有在允许的时间内完成 YES
  • Hystrix工作步骤说明以及服务监控hystrixDashboard

    目录 一 步骤说明和流程解析 二 服务监控hystrixDashboard 官网 How it Works Netflix Hystrix Wiki GitHub 一 步骤说明和流程解析 1 创建 HystrixCommand 用在依赖的服
  • 十三、断路器-Hystrix 的隔离策略

    版权声明 本文为博主原创文章 未经博主允许不得转载 https blog csdn net dengqiang123456 article details 75935122 说明 1 Hystrix 通过舱壁模式来隔离限制依赖的并发量和阻塞
  • 第六章 Hystrix断路器详解+环境搭建

    目录 一 Hystrix的背景及介绍 1 分布式系统面临的问题 2 解决方案 3 Hystrix介绍 4 Hystrix服务熔断 二 搭建项目基础环境 1 创建 父工程及公共api 见 第三章 2 创建 Eureka 服务 见 第三章 3
  • Hystrix使用说明,配置参数说明

    四 配置信息 default或HystrixCommandKey 最常用的几项 超时时间 默认1000ms 单位 ms 1 hystrix command default execution isolation thread timeout
  • Spring Cloud中的Hystrix的实现和使用

    Spring Cloud Hystrix 是 Spring Cloud 生态系统中的一个断路器组件 它可以帮助开发者优雅地处理分布式系统中的故障 提高系统的容错能力 下面介绍 Spring Cloud Hystrix 的实现和使用 引入依赖
  • 谈谈我对服务熔断、服务降级的理解

    伴随着微服务架构被宣传得如火如荼 一些概念也被推到了我们面前 管你接受不接受 其实大多数概念以前就有 但很少被提的这么频繁 现在好像不提及都不好意思交流了 想起有人总结的一句话 微服务架构的特点就是 一解释就懂 一问就不知 一讨论就吵架 其
  • feign和ribbon同时设置connectTimeout readTimeout,谁会先起作用

    feign client config default connectTimeout 1000000 readTimeout 1200000 hystrix enabled true ribbon eager load enable tru
  • 无法找到名为 CircuitBreaker 的 GatewayFilterFactory

    属性文件 server port 8999 eureka instance hostname localhost Actuator Configuration management endpoints web exposure includ
  • Spring Boot 中的 Hystrix 仪表板问题

    我是 Hystrix 仪表板的新手 我已经用 Hystrix 编写了示例应用程序 我想查看 Hystrix 图表 命令指标流 但我收到以下错误 Circuit Unable to connect to Command Metric Stre
  • 当目标系统关闭时,停止 Spring Cloud Stream @StreamListener 监听

    我有一个应用程序 它从 Kafka 获取消息并调用目标系统来更新旧版 Oracle 数据库 我想要启用一个场景 如果目标系统关闭 则将消息留在 Kafka 总线上 并且在给定的时间内不处理它们 我正在考虑一些基于 Hystrix 的断路器解
  • 电路如何再次闭合?

    我正在尝试理解 Hystrix 据我所知 当服务调用第三方服务并且该服务没有响应并且阈值已超过配置时 电路将被打开 并且后续呼叫将被短路 但我无法理解电路如何再次闭合 让我们假设我们的服务正在调用第三方服务 并且该服务无法正常工作 因此电路
  • Hystrix 仪表板始终显示加载屏幕

    我使用 Netflix OSS 库开发了微服务应用程序 我在 localhost 9091 hystrix 上运行的 Hystrix 仪表板上遇到问题 我想监控微服务A和微服务B之间的请求指标 端点 hystrix stream 已注册 h
  • 如何通过JMX暴露Hystrix的断路器状态

    我一直在寻找有关如何在 JMX 上公开 Hystrix 断路器状态的教程 我刚刚发现了一个用于公开指标 例如计数器 仪表等 的 API 使用hystrix servo metrics publisher 是否可以在 JMX 上公开断路器状态
  • Hystrix 仪表板卡在加载屏幕上

    我在 localhost 8988 hystrix 上运行 Hystrix 仪表板 我想监视 OrderService 和 ProductService 之间的请求 端点 hystrix stream 已经注册 并且 hystrix 仪表板
  • 使用环境变量设置 Hystrix 超时

    为了更改 Hystrix 的默认请求超时 1000ms 必须设置以下属性 hystrix command default execution isolation thread timeoutInMilliseconds 2000 对应的环境
  • Netflix Archaius 动态配置

    我正在将 Hystrix 集成到现有项目中 并且希望从 xml 文件中读取配置值 而不是使用配置管理器提供配置属性 当 xml 文件中的值更新时 我希望 Hystrix 配置在运行时更新 这是我遵循的指南 https github com
  • 如何在多个 feign 客户端之一中禁用 hystrix

    在我的 Spring Boot 应用程序中 我使用多个 feign 客户端 FeignClient hello service 对于其中许多情况 我需要一种断路器机制 因此我有以下配置行 feign hystrix enabled true

随机推荐