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 仪表板卡在加载屏幕上 的相关文章

  • Hystrix Dashboard (断路器:Hystrix 仪表盘)

    目录 pom xml添加依赖 启动类添加 64 EnableHystrixDashboard注解 浏览器访问 pom xml添加依赖 lt dependency gt lt groupId gt org springframework bo
  • 记一次压测Feign调用时Hystrix could not be queued for execution and no fallback available.

    项目场景 xff1a 同事压测时反馈仅支持10个用户的并发量 问题描述 通过查看日志 xff0c 可以看到一下关键报错信息 xff1a could not be queued for execution and no fallback av
  • springcloud整合Hystrix,实现接口服务降级

    利用Hystrix对接口control层进行服务降级 新建子工程service03 作为测试Hystrix服务降级的微服务 pom xml
  • 客户端负载均衡Feign之四:Feign配置

    Ribbon配置 在Feign中配置Ribbon非常简单 直接在application properties中配置即可 如 设置连接超时时间 ribbon ConnectTimeout 500 设置读取超时时间 ribbon ReadTim
  • hystrix详述(2)- 配置

    一 hystrix在生产中的建议 1 保持timeout的默认值 1000ms 除非需要修改 其实通常会修改 2 保持threadpool的的线程数为10个 除非需要更多 3 依赖标准的报警和监控系统来捕获问题 4 通过dashboards
  • Hystrix中线程上下文ThreadLocal

    ThreadLocal 在Java编程语言里ThreadLocal是用来方便开发人员在同一线程上下文中不同类 不同方法中共享信息的 ThreadLocal变量不受其他线程的影响 不同线程间相互隔离 也就是线程安全的 在实际的业务链路中从入口
  • SpringCloud - Spring Cloud Netflix 之 Hystrix熔断器(七)

    阅读本文前可先参考 SpringCloud Spring Cloud根 父项目 开发准备 二 MinggeQingchun的博客 CSDN博客 在微服务架构中 一个应用往往由多个服务组成 这些服务之间相互依赖 依赖关系错综复杂 通常情况下
  • springcloud集成hystrix 实现服务的隔离,熔断,降级

    一 pom引入依赖
  • 谈谈我对服务熔断、服务降级的理解

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

    feign client config default connectTimeout 1000000 readTimeout 1200000 hystrix enabled true ribbon eager load enable tru
  • springcloud整合Hystrix

    作用 1 服务降级 触发情况 程序运行异常 超时 服务熔断触发服务降级 线程池 信号量打满也会触发服务降级 2 服务熔断 直接拒绝访问 即使有正确的访问也会短路 3 服务限流 排队有序进行 构建服务 1 建module provider h
  • SpringBoot集成hystrix

    文章目录 hystrix有什么用 在SpringBoot项目中集成 更多配置示例 配置线程池 配置信号量 配合feignClient使用 基本配置 可视化组件 视图hystrix dashboard 汇总监控turbine 参考 hystr
  • springcloud-eureka集群-整合hystrix框架整合feign

    继之前的项目继续扩展 整合hystrix和feign这两个框架 1 修改服务器调用者的application yml 增加如下代码 打开feign对hystrix的支持 feign hystrix enabled true 配置hystri
  • 测试 Hystrix 断路器配置

    我们的应用程序是通过使用 Hystrix 实现断路器模式以抗脆弱的方式编写的 整个应用程序是使用测试驱动实践创建的 但陷入了我们需要通过在方法上配置相同策略来实现断路器策略的阶段 以下是我们使用的示例配置 HystrixCommand co
  • 当目标系统关闭时,停止 Spring Cloud Stream @StreamListener 监听

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

    Spring Cloud Hystrix 断路器模式示例 我在代码中添加了以下依赖项https howtodoinjava com spring spring cloud spring hystrix Circuit breaker tut
  • 使用 Hystrix Spring Cloud 进行单元测试回退的任何示例

    我想测试以下场景 Set the hystrix command default execution isolation thread timeoutInMillisecond值设置为低值 然后查看我的应用程序的行为方式 使用单元测试检查我
  • Hystrix 忽略运行超时

    我正在尝试使用 Hystrix 我理解文档 即使通过 运行 同步调用 Hystrix 命令也会默认在线程中运行 并且应该受到 Hystrix 中配置的超时的影响 但当我尝试时 似乎没有发生超时 我是否误解了文档 或者我做错了什么 有没有办法
  • Hystrix是否可以订阅CircuitBreaker开启事件?

    对于单元测试 我希望能够订阅 Hystrix 事件 特别是在断路器打开或关闭时发生事件 我四处寻找示例 似乎解决方法是利用指标流并监视断路器标志 由于 Hystrix 是基于 RxJava 构建的 我认为应该在某个地方有一个事件订阅接口 在
  • 如何在多个 feign 客户端之一中禁用 hystrix

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

随机推荐