日日操夜夜添-日日操影院-日日草夜夜操-日日干干-精品一区二区三区波多野结衣-精品一区二区三区高清免费不卡

公告:魔扣目錄網為廣大站長提供免費收錄網站服務,提交前請做好本站友鏈:【 網站目錄:http://www.ylptlb.cn 】, 免友鏈快審服務(50元/站),

點擊這里在線咨詢客服
新站提交
  • 網站:51998
  • 待審:31
  • 小程序:12
  • 文章:1030137
  • 會員:747

本文介紹了找不到名為斷路器的GatewayFilterFactory的處理方法,對大家解決問題具有一定的參考價值,需要的朋友們下面隨著小編來一起學習吧!

問題描述

屬性文件

server:
  port: 8999
  
eureka:
  instance:
    hostname: localhost

    
#Actuator Configuration
management:
  endpoints:
    web:
      exposure:
        include: hystrix.stream, health, info  
        
#Hystrix Configuration
hystrix:
  command:
    fallbackcmd:
      execution:
        isolation:
          thread:
            timeoutInMilliseconds: 4000


spring:
  application:
    name: gateway
  cloud:
    gateway:
      routes:
      - id: capability-deck
        uri: lb://capability-deck
        predicates:
        - Path=/capability/**
        filters:
            - name: CircuitBreaker
              args:
                name: capability-deck
                fallbackuri: forward:/capabilityServiceFallBack
        
     
      - id: home-page
        uri: lb://home-page
        predicates:
        - Path=/home/**
      
        
      - id: subscription
        uri: lb://subscription
        predicates:
        - Path=/subscription/**
       
       
        

控制器

package com.valuepedia.gateway.controller;

import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class FallBackController {

    @GetMapping("/subscriptionServiceFallBack")
    public String userServiceFallBackMethod() {
        return "Subscription Service is taking longer than Expected." +
                " Please try again later";
    }

    @GetMapping("/capabilityServiceFallBack")
    public String capabilityServiceFallBackMethod() {
        return "Capability Service is taking longer than Expected." +
                " Please try again later";
    }
    
    @GetMapping("/homeServiceFallBack")
    public String homeServiceFallBackMethod() {
        return "Home Service is taking longer than Expected." +
                " Please try again later";
    }
}

主類

package com.valuepedia.gateway;

import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.cloud.netflix.eureka.EnableEurekaClient;
import org.springframework.cloud.netflix.hystrix.EnableHystrix;
import org.springframework.context.annotation.Bean;

@SpringBootApplication
@EnableEurekaClient
@EnableHystrix
public class GatewayApplication {

    public static void main(String[] args) {
        SpringApplication.run(GatewayApplication.class, args);
    }
}

獲取錯誤消息為


  .   ____          _            __ _ _
 /\ / ___'_ __ _ _(_)_ __  __ _    
( ( )\___ | '_ | '_| | '_ / _` |    
 \/  ___)| |_)| | | | | || (_| |  ) ) ) )
  '  |____| .__|_| |_|_| |_\__, | / / / /
 =========|_|==============|___/=/_/_/_/
[32m :: Spring Boot :: [39m              [2m (v2.5.4)[0;39m

[2m2021-09-21 09:44:08.705[0;39m [32m INFO[0;39m [35m7852[0;39m [2m---[0;39m [2m[           main][0;39m [36mc.valuepedia.gateway.GatewayApplication [0;39m [2m:[0;39m Starting GatewayApplication using Java 15.0.2 on A2568L with PID 7852 (D:ValuepediaGateway	argetclasses started by Swapnil.Soni in D:ValuepediaGateway)
[2m2021-09-21 09:44:08.714[0;39m [32m INFO[0;39m [35m7852[0;39m [2m---[0;39m [2m[           main][0;39m [36mc.valuepedia.gateway.GatewayApplication [0;39m [2m:[0;39m No active profile set, falling back to default profiles: default
[2m2021-09-21 09:44:10.561[0;39m [33m WARN[0;39m [35m7852[0;39m [2m---[0;39m [2m[           main][0;39m [36mo.s.boot.actuate.endpoint.EndpointId    [0;39m [2m:[0;39m Endpoint ID 'hystrix.stream' contains invalid characters, please migrate to a valid format.
[2m2021-09-21 09:44:13.646[0;39m [32m INFO[0;39m [35m7852[0;39m [2m---[0;39m [2m[           main][0;39m [36mo.s.cloud.context.scope.GenericScope    [0;39m [2m:[0;39m BeanFactory id=86068429-c6fe-399f-b31b-17fdee65f911
[2m2021-09-21 09:44:14.693[0;39m [32m INFO[0;39m [35m7852[0;39m [2m---[0;39m [2m[           main][0;39m [36mtrationDelegate$BeanPostProcessorChecker[0;39m [2m:[0;39m Bean 'org.springframework.cloud.client.loadbalancer.reactive.LoadBalancerBeanPostProcessorAutoConfiguration' of type [org.springframework.cloud.client.loadbalancer.reactive.LoadBalancerBeanPostProcessorAutoConfiguration] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
[2m2021-09-21 09:44:14.697[0;39m [32m INFO[0;39m [35m7852[0;39m [2m---[0;39m [2m[           main][0;39m [36mtrationDelegate$BeanPostProcessorChecker[0;39m [2m:[0;39m Bean 'org.springframework.cloud.client.loadbalancer.reactive.LoadBalancerBeanPostProcessorAutoConfiguration$ReactorDeferringLoadBalancerFilterConfig' of type [org.springframework.cloud.client.loadbalancer.reactive.LoadBalancerBeanPostProcessorAutoConfiguration$ReactorDeferringLoadBalancerFilterConfig] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
[2m2021-09-21 09:44:14.701[0;39m [32m INFO[0;39m [35m7852[0;39m [2m---[0;39m [2m[           main][0;39m [36mtrationDelegate$BeanPostProcessorChecker[0;39m [2m:[0;39m Bean 'reactorDeferringLoadBalancerExchangeFilterFunction' of type [org.springframework.cloud.client.loadbalancer.reactive.DeferringLoadBalancerExchangeFilterFunction] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
[2m2021-09-21 09:44:15.438[0;39m [33m WARN[0;39m [35m7852[0;39m [2m---[0;39m [2m[           main][0;39m [36mc.n.c.sources.URLConfigurationSource    [0;39m [2m:[0;39m No URLs will be polled as dynamic configuration sources.
[2m2021-09-21 09:44:15.440[0;39m [32m INFO[0;39m [35m7852[0;39m [2m---[0;39m [2m[           main][0;39m [36mc.n.c.sources.URLConfigurationSource    [0;39m [2m:[0;39m To enable URLs as dynamic configuration sources, define System property archaius.configurationSource.additionalUrls or make config.properties available on classpath.
[2m2021-09-21 09:44:15.463[0;39m [33m WARN[0;39m [35m7852[0;39m [2m---[0;39m [2m[           main][0;39m [36mc.n.c.sources.URLConfigurationSource    [0;39m [2m:[0;39m No URLs will be polled as dynamic configuration sources.
[2m2021-09-21 09:44:15.463[0;39m [32m INFO[0;39m [35m7852[0;39m [2m---[0;39m [2m[           main][0;39m [36mc.n.c.sources.URLConfigurationSource    [0;39m [2m:[0;39m To enable URLs as dynamic configuration sources, define System property archaius.configurationSource.additionalUrls or make config.properties available on classpath.
[2m2021-09-21 09:44:19.020[0;39m [32m INFO[0;39m [35m7852[0;39m [2m---[0;39m [2m[           main][0;39m [36mo.s.c.g.r.RouteDefinitionRouteLocator   [0;39m [2m:[0;39m Loaded RoutePredicateFactory [After]
[2m2021-09-21 09:44:19.021[0;39m [32m INFO[0;39m [35m7852[0;39m [2m---[0;39m [2m[           main][0;39m [36mo.s.c.g.r.RouteDefinitionRouteLocator   [0;39m [2m:[0;39m Loaded RoutePredicateFactory [Before]
[2m2021-09-21 09:44:19.021[0;39m [32m INFO[0;39m [35m7852[0;39m [2m---[0;39m [2m[           main][0;39m [36mo.s.c.g.r.RouteDefinitionRouteLocator   [0;39m [2m:[0;39m Loaded RoutePredicateFactory [Between]
[2m2021-09-21 09:44:19.021[0;39m [32m INFO[0;39m [35m7852[0;39m [2m---[0;39m [2m[           main][0;39m [36mo.s.c.g.r.RouteDefinitionRouteLocator   [0;39m [2m:[0;39m Loaded RoutePredicateFactory [Cookie]
[2m2021-09-21 09:44:19.022[0;39m [32m INFO[0;39m [35m7852[0;39m [2m---[0;39m [2m[           main][0;39m [36mo.s.c.g.r.RouteDefinitionRouteLocator   [0;39m [2m:[0;39m Loaded RoutePredicateFactory [Header]
[2m2021-09-21 09:44:19.022[0;39m [32m INFO[0;39m [35m7852[0;39m [2m---[0;39m [2m[           main][0;39m [36mo.s.c.g.r.RouteDefinitionRouteLocator   [0;39m [2m:[0;39m Loaded RoutePredicateFactory [Host]
[2m2021-09-21 09:44:19.022[0;39m [32m INFO[0;39m [35m7852[0;39m [2m---[0;39m [2m[           main][0;39m [36mo.s.c.g.r.RouteDefinitionRouteLocator   [0;39m [2m:[0;39m Loaded RoutePredicateFactory [Method]
[2m2021-09-21 09:44:19.023[0;39m [32m INFO[0;39m [35m7852[0;39m [2m---[0;39m [2m[           main][0;39m [36mo.s.c.g.r.RouteDefinitionRouteLocator   [0;39m [2m:[0;39m Loaded RoutePredicateFactory [Path]
[2m2021-09-21 09:44:19.025[0;39m [32m INFO[0;39m [35m7852[0;39m [2m---[0;39m [2m[           main][0;39m [36mo.s.c.g.r.RouteDefinitionRouteLocator   [0;39m [2m:[0;39m Loaded RoutePredicateFactory [Query]
[2m2021-09-21 09:44:19.026[0;39m [32m INFO[0;39m [35m7852[0;39m [2m---[0;39m [2m[           main][0;39m [36mo.s.c.g.r.RouteDefinitionRouteLocator   [0;39m [2m:[0;39m Loaded RoutePredicateFactory [ReadBody]
[2m2021-09-21 09:44:19.027[0;39m [32m INFO[0;39m [35m7852[0;39m [2m---[0;39m [2m[           main][0;39m [36mo.s.c.g.r.RouteDefinitionRouteLocator   [0;39m [2m:[0;39m Loaded RoutePredicateFactory [RemoteAddr]
[2m2021-09-21 09:44:19.027[0;39m [32m INFO[0;39m [35m7852[0;39m [2m---[0;39m [2m[           main][0;39m [36mo.s.c.g.r.RouteDefinitionRouteLocator   [0;39m [2m:[0;39m Loaded RoutePredicateFactory [Weight]
[2m2021-09-21 09:44:19.027[0;39m [32m INFO[0;39m [35m7852[0;39m [2m---[0;39m [2m[           main][0;39m [36mo.s.c.g.r.RouteDefinitionRouteLocator   [0;39m [2m:[0;39m Loaded RoutePredicateFactory [CloudFoundryRouteService]
[2m2021-09-21 09:44:21.669[0;39m [32m INFO[0;39m [35m7852[0;39m [2m---[0;39m [2m[           main][0;39m [36mo.s.b.a.e.web.EndpointLinksResolver     [0;39m [2m:[0;39m Exposing 3 endpoint(s) beneath base path '/actuator'
[2m2021-09-21 09:44:22.230[0;39m [32m INFO[0;39m [35m7852[0;39m [2m---[0;39m [2m[           main][0;39m [36mDiscoveryClientOptionalArgsConfiguration[0;39m [2m:[0;39m Eureka HTTP Client uses RestTemplate.
[2m2021-09-21 09:44:22.424[0;39m [33m WARN[0;39m [35m7852[0;39m [2m---[0;39m [2m[           main][0;39m [36miguration$LoadBalancerCaffeineWarnLogger[0;39m [2m:[0;39m Spring Cloud LoadBalancer is currently working with the default cache. You can switch to using Caffeine cache, by adding it and org.springframework.cache.caffeine.CaffeineCacheManager to the classpath.
[2m2021-09-21 09:44:22.611[0;39m [32m INFO[0;39m [35m7852[0;39m [2m---[0;39m [2m[           main][0;39m [36mo.s.c.n.eureka.InstanceInfoFactory      [0;39m [2m:[0;39m Setting initial instance status as: STARTING
[2m2021-09-21 09:44:22.800[0;39m [32m INFO[0;39m [35m7852[0;39m [2m---[0;39m [2m[           main][0;39m [36mcom.netflix.discovery.DiscoveryClient   [0;39m [2m:[0;39m Initializing Eureka in region us-east-1
[2m2021-09-21 09:44:22.820[0;39m [32m INFO[0;39m [35m7852[0;39m [2m---[0;39m [2m[           main][0;39m [36mc.n.d.s.r.aws.ConfigClusterResolver     [0;39m [2m:[0;39m Resolving eureka endpoints via configuration
[2m2021-09-21 09:44:22.919[0;39m [32m INFO[0;39m [35m7852[0;39m [2m---[0;39m [2m[           main][0;39m [36mcom.netflix.discovery.DiscoveryClient   [0;39m [2m:[0;39m Disable delta property : false
[2m2021-09-21 09:44:22.919[0;39m [32m INFO[0;39m [35m7852[0;39m [2m---[0;39m [2m[           main][0;39m [36mcom.netflix.discovery.DiscoveryClient   [0;39m [2m:[0;39m Single vip registry refresh property : null
[2m2021-09-21 09:44:22.919[0;39m [32m INFO[0;39m [35m7852[0;39m [2m---[0;39m [2m[           main][0;39m [36mcom.netflix.discovery.DiscoveryClient   [0;39m [2m:[0;39m Force full registry fetch : false
[2m2021-09-21 09:44:22.920[0;39m [32m INFO[0;39m [35m7852[0;39m [2m---[0;39m [2m[           main][0;39m [36mcom.netflix.discovery.DiscoveryClient   [0;39m [2m:[0;39m Application is null : false
[2m2021-09-21 09:44:22.920[0;39m [32m INFO[0;39m [35m7852[0;39m [2m---[0;39m [2m[           main][0;39m [36mcom.netflix.discovery.DiscoveryClient   [0;39m [2m:[0;39m Registered Applications size is zero : true
[2m2021-09-21 09:44:22.920[0;39m [32m INFO[0;39m [35m7852[0;39m [2m---[0;39m [2m[           main][0;39m [36mcom.netflix.discovery.DiscoveryClient   [0;39m [2m:[0;39m Application version is -1: true
[2m2021-09-21 09:44:22.920[0;39m [32m INFO[0;39m [35m7852[0;39m [2m---[0;39m [2m[           main][0;39m [36mcom.netflix.discovery.DiscoveryClient   [0;39m [2m:[0;39m Getting all instance registry info from the eureka server
[2m2021-09-21 09:44:24.054[0;39m [32m INFO[0;39m [35m7852[0;39m [2m---[0;39m [2m[           main][0;39m [36mcom.netflix.discovery.DiscoveryClient   [0;39m [2m:[0;39m The response status is 200
[2m2021-09-21 09:44:24.067[0;39m [32m INFO[0;39m [35m7852[0;39m [2m---[0;39m [2m[           main][0;39m [36mcom.netflix.discovery.DiscoveryClient   [0;39m [2m:[0;39m Starting heartbeat executor: renew interval is: 30
[2m2021-09-21 09:44:24.081[0;39m [32m INFO[0;39m [35m7852[0;39m [2m---[0;39m [2m[           main][0;39m [36mc.n.discovery.InstanceInfoReplicator    [0;39m [2m:[0;39m InstanceInfoReplicator onDemand update allowed rate per min is 4
[2m2021-09-21 09:44:24.119[0;39m [32m INFO[0;39m [35m7852[0;39m [2m---[0;39m [2m[           main][0;39m [36mcom.netflix.discovery.DiscoveryClient   [0;39m [2m:[0;39m Discovery Client initialized at timestamp 1632197664116 with initial instances count: 0
[2m2021-09-21 09:44:24.126[0;39m [32m INFO[0;39m [35m7852[0;39m [2m---[0;39m [2m[           main][0;39m [36mo.s.c.n.e.s.EurekaServiceRegistry       [0;39m [2m:[0;39m Registering application GATEWAY with eureka with status UP
[2m2021-09-21 09:44:24.127[0;39m [32m INFO[0;39m [35m7852[0;39m [2m---[0;39m [2m[           main][0;39m [36mcom.netflix.discovery.DiscoveryClient   [0;39m [2m:[0;39m Saw local status change event StatusChangeEvent [timestamp=1632197664127, current=UP, previous=STARTING]
[2m2021-09-21 09:44:24.131[0;39m [32m INFO[0;39m [35m7852[0;39m [2m---[0;39m [2m[nfoReplicator-0][0;39m [36mcom.netflix.discovery.DiscoveryClient   [0;39m [2m:[0;39m DiscoveryClient_GATEWAY/A2568L.corp.ads.valuelabs.net:gateway:8999: registering service...
[2m2021-09-21 09:44:24.201[0;39m [32m INFO[0;39m [35m7852[0;39m [2m---[0;39m [2m[nfoReplicator-0][0;39m [36mcom.netflix.discovery.DiscoveryClient   [0;39m [2m:[0;39m DiscoveryClient_GATEWAY/A2568L.corp.ads.valuelabs.net:gateway:8999 - registration status: 204
[2m2021-09-21 09:44:24.270[0;39m [31mERROR[0;39m [35m7852[0;39m [2m---[0;39m [2m[           main][0;39m [36mo.s.c.gateway.route.CachingRouteLocator [0;39m [2m:[0;39m Refresh routes error !!!

java.lang.IllegalArgumentException: Unable to find GatewayFilterFactory with name CircuitBreaker
    at org.springframework.cloud.gateway.route.RouteDefinitionRouteLocator.loadGatewayFilters(RouteDefinitionRouteLocator.java:130) ~[spring-cloud-gateway-server-3.0.3.jar:3.0.3]
    at org.springframework.cloud.gateway.route.RouteDefinitionRouteLocator.getFilters(RouteDefinitionRouteLocator.java:176) ~[spring-cloud-gateway-server-3.0.3.jar:3.0.3]
    at org.springframework.cloud.gateway.route.RouteDefinitionRouteLocator.convertToRoute(RouteDefinitionRouteLocator.java:117) ~[spring-cloud-gateway-server-3.0.3.jar:3.0.3]
    at reactor.core.publisher.FluxMap$MapSubscriber.onNext(FluxMap.java:106) ~[reactor-core-3.4.9.jar:3.4.9]
    at reactor.core.publisher.FluxFlatMap$FlatMapMain.tryEmitScalar(FluxFlatMap.java:488) ~[reactor-core-3.4.9.jar:3.4.9]
    at reactor.core.publisher.FluxFlatMap$FlatMapMain.onNext(FluxFlatMap.java:421) ~[reactor-core-3.4.9.jar:3.4.9]
    at reactor.core.publisher.FluxMergeSequential$MergeSequentialMain.drain(FluxMergeSequential.java:432) ~[reactor-core-3.4.9.jar:3.4.9]
    at reactor.core.publisher.FluxMergeSequential$MergeSequentialMain.innerComplete(FluxMergeSequential.java:328) ~[reactor-core-3.4.9.jar:3.4.9]
    at reactor.core.publisher.FluxMergeSequential$MergeSequentialInner.onSubscribe(FluxMergeSequential.java:552) ~[reactor-core-3.4.9.jar:3.4.9]
    at reactor.core.publisher.FluxIterable.subscribe(FluxIterable.java:164) ~[reactor-core-3.4.9.jar:3.4.9]
    at reactor.core.publisher.FluxIterable.subscribe(FluxIterable.java:86) ~[reactor-core-3.4.9.jar:3.4.9]
    at reactor.core.publisher.Flux.subscribe(Flux.java:8411) ~[reactor-core-3.4.9.jar:3.4.9]
    at reactor.core.publisher.FluxMergeSequential$MergeSequentialMain.onNext(FluxMergeSequential.java:237) ~[reactor-core-3.4.9.jar:3.4.9]
    at reactor.core.publisher.FluxIterable$IterableSubscription.slowPath(FluxIterable.java:270) ~[reactor-core-3.4.9.jar:3.4.9]
    at reactor.core.publisher.FluxIterable$IterableSubscription.request(FluxIterable.java:228) ~[reactor-core-3.4.9.jar:3.4.9]
    at reactor.core.publisher.FluxMergeSequential$MergeSequentialMain.onSubscribe(FluxMergeSequential.java:198) ~[reactor-core-3.4.9.jar:3.4.9]
    at reactor.core.publisher.FluxIterable.subscribe(FluxIterable.java:164) ~[reactor-core-3.4.9.jar:3.4.9]
    at reactor.core.publisher.FluxIterable.subscribe(FluxIterable.java:86) ~[reactor-core-3.4.9.jar:3.4.9]
    at reactor.core.publisher.Flux.subscribe(Flux.java:8411) ~[reactor-core-3.4.9.jar:3.4.9]
    at reactor.core.publisher.FluxMergeSequential$MergeSequentialMain.onNext(FluxMergeSequential.java:237) ~[reactor-core-3.4.9.jar:3.4.9]
    at reactor.core.publisher.FluxIterable$IterableSubscription.slowPath(FluxIterable.java:270) ~[reactor-core-3.4.9.jar:3.4.9]
    at reactor.core.publisher.FluxIterable$IterableSubscription.request(FluxIterable.java:228) ~[reactor-core-3.4.9.jar:3.4.9]
    at reactor.core.publisher.FluxMergeSequential$MergeSequentialMain.onSubscribe(FluxMergeSequential.java:198) ~[reactor-core-3.4.9.jar:3.4.9]
    at reactor.core.publisher.FluxIterable.subscribe(FluxIterable.java:164) ~[reactor-core-3.4.9.jar:3.4.9]
    at reactor.core.publisher.FluxIterable.subscribe(FluxIterable.java:86) ~[reactor-core-3.4.9.jar:3.4.9]
    at reactor.core.publisher.Mono.subscribe(Mono.java:4338) ~[reactor-core-3.4.9.jar:3.4.9]
    at reactor.core.publisher.Mono.subscribeWith(Mono.java:4453) ~[reactor-core-3.4.9.jar:3.4.9]
    at reactor.core.publisher.Mono.subscribe(Mono.java:4309) ~[reactor-core-3.4.9.jar:3.4.9]
    at reactor.core.publisher.Mono.subscribe(Mono.java:4245) ~[reactor-core-3.4.9.jar:3.4.9]
    at reactor.core.publisher.Mono.subscribe(Mono.java:4217) ~[reactor-core-3.4.9.jar:3.4.9]
    at org.springframework.cloud.gateway.route.CachingRouteLocator.onApplicationEvent(CachingRouteLocator.java:81) ~[spring-cloud-gateway-server-3.0.3.jar:3.0.3]
    at org.springframework.cloud.gateway.route.CachingRouteLocator.onApplicationEvent(CachingRouteLocator.java:40) ~[spring-cloud-gateway-server-3.0.3.jar:3.0.3]
    at org.springframework.context.event.SimpleApplicationEventMulticaster.doInvokeListener(SimpleApplicationEventMulticaster.java:176) ~[spring-context-5.3.9.jar:5.3.9]
    at org.springframework.context.event.SimpleApplicationEventMulticaster.invokeListener(SimpleApplicationEventMulticaster.java:169) ~[spring-context-5.3.9.jar:5.3.9]
    at org.springframework.context.event.SimpleApplicationEventMulticaster.multicastEvent(SimpleApplicationEventMulticaster.java:143) ~[spring-context-5.3.9.jar:5.3.9]
    at org.springframework.context.support.AbstractApplicationContext.publishEvent(AbstractApplicationContext.java:421) ~[spring-context-5.3.9.jar:5.3.9]
    at org.springframework.context.support.AbstractApplicationContext.publishEvent(AbstractApplicationContext.java:378) ~[spring-context-5.3.9.jar:5.3.9]
    at org.springframework.cloud.gateway.route.RouteRefreshListener.reset(RouteRefreshListener.java:73) ~[spring-cloud-gateway-server-3.0.3.jar:3.0.3]
    at org.springframework.cloud.gateway.route.RouteRefreshListener.onApplicationEvent(RouteRefreshListener.java:54) ~[spring-cloud-gateway-server-3.0.3.jar:3.0.3]
    at org.springframework.context.event.SimpleApplicationEventMulticaster.doInvokeListener(SimpleApplicationEventMulticaster.java:176) ~[spring-context-5.3.9.jar:5.3.9]
    at org.springframework.context.event.SimpleApplicationEventMulticaster.invokeListener(SimpleApplicationEventMulticaster.java:169) ~[spring-context-5.3.9.jar:5.3.9]
    at org.springframework.context.event.SimpleApplicationEventMulticaster.multicastEvent(SimpleApplicationEventMulticaster.java:143) ~[spring-context-5.3.9.jar:5.3.9]
    at org.springframework.context.support.AbstractApplicationContext.publishEvent(AbstractApplicationContext.java:421) ~[spring-context-5.3.9.jar:5.3.9]
    at org.springframework.context.support.AbstractApplicationContext.publishEvent(AbstractApplicationContext.java:378) ~[spring-context-5.3.9.jar:5.3.9]
    at org.springframework.cloud.netflix.eureka.serviceregistry.EurekaAutoServiceRegistration.start(EurekaAutoServiceRegistration.java:85) ~[spring-cloud-netflix-eureka-client-3.0.3.jar:3.0.3]
    at org.springframework.context.support.DefaultLifecycleProcessor.doStart(DefaultLifecycleProcessor.java:178) ~[spring-context-5.3.9.jar:5.3.9]
    at org.springframework.context.support.DefaultLifecycleProcessor.access$200(DefaultLifecycleProcessor.java:54) ~[spring-context-5.3.9.jar:5.3.9]
    at org.springframework.context.support.DefaultLifecycleProcessor$LifecycleGroup.start(DefaultLifecycleProcessor.java:356) ~[spring-context-5.3.9.jar:5.3.9]
    at java.base/java.lang.Iterable.forEach(Iterable.java:75) ~[na:na]
    at org.springframework.context.support.DefaultLifecycleProcessor.startBeans(DefaultLifecycleProcessor.java:155) ~[spring-context-5.3.9.jar:5.3.9]
    at org.springframework.context.support.DefaultLifecycleProcessor.onRefresh(DefaultLifecycleProcessor.java:123) ~[spring-context-5.3.9.jar:5.3.9]
    at org.springframework.context.support.AbstractApplicationContext.finishRefresh(AbstractApplicationContext.java:935) ~[spring-context-5.3.9.jar:5.3.9]
    at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:586) ~[spring-context-5.3.9.jar:5.3.9]
    at org.springframework.boot.web.reactive.context.ReactiveWebServerApplicationContext.refresh(ReactiveWebServerApplicationContext.java:64) ~[spring-boot-2.5.4.jar:2.5.4]
    at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:754) ~[spring-boot-2.5.4.jar:2.5.4]
    at org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:434) ~[spring-boot-2.5.4.jar:2.5.4]
    at org.springframework.boot.SpringApplication.run(SpringApplication.java:338) ~[spring-boot-2.5.4.jar:2.5.4]
    at org.springframework.boot.SpringApplication.run(SpringApplication.java:1343) ~[spring-boot-2.5.4.jar:2.5.4]
    at org.springframework.boot.SpringApplication.run(SpringApplication.java:1332) ~[spring-boot-2.5.4.jar:2.5.4]
    at com.valuepedia.gateway.GatewayApplication.main(GatewayApplication.java:15) ~[classes/:na]

[2m2021-09-21 09:44:24.290[0;39m [33m WARN[0;39m [35m7852[0;39m [2m---[0;39m [2m[           main][0;39m [36monfigReactiveWebServerApplicationContext[0;39m [2m:[0;39m Exception encountered during context initialization - cancelling refresh attempt: org.springframework.context.ApplicationContextException: Failed to start bean 'eurekaAutoServiceRegistration'; nested exception is java.lang.IllegalArgumentException: Unable to find GatewayFilterFactory with name CircuitBreaker
[2m2021-09-21 09:44:24.347[0;39m [32m INFO[0;39m [35m7852[0;39m [2m---[0;39m [2m[           main][0;39m [36mcom.netflix.discovery.DiscoveryClient   [0;39m [2m:[0;39m Shutting down DiscoveryClient ...
[2m2021-09-21 09:44:27.370[0;39m [32m INFO[0;39m [35m7852[0;39m [2m---[0;39m [2m[           main][0;39m [36mcom.netflix.discovery.DiscoveryClient   [0;39m [2m:[0;39m Unregistering ...
[2m2021-09-21 09:44:27.384[0;39m [32m INFO[0;39m [35m7852[0;39m [2m---[0;39m [2m[           main][0;39m [36mcom.netflix.discovery.DiscoveryClient   [0;39m [2m:[0;39m DiscoveryClient_GATEWAY/A2568L.corp.ads.valuelabs.net:gateway:8999 - deregister  status: 200
[2m2021-09-21 09:44:27.538[0;39m [32m INFO[0;39m [35m7852[0;39m [2m---[0;39m [2m[           main][0;39m [36mcom.netflix.discovery.DiscoveryClient   [0;39m [2m:[0;39m Completed shut down of DiscoveryClient
[2m2021-09-21 09:44:27.549[0;39m [32m INFO[0;39m [35m7852[0;39m [2m---[0;39m [2m[           main][0;39m [36mConditionEvaluationReportLoggingListener[0;39m [2m:[0;39m 

Error starting ApplicationContext. To display the conditions report re-run your application with 'debug' enabled.
[2m2021-09-21 09:44:27.593[0;39m [31mERROR[0;39m [35m7852[0;39m [2m---[0;39m [2m[           main][0;39m [36mo.s.boot.SpringApplication              [0;39m [2m:[0;39m Application run failed

org.springframework.context.ApplicationContextException: Failed to start bean 'eurekaAutoServiceRegistration'; nested exception is java.lang.IllegalArgumentException: Unable to find GatewayFilterFactory with name CircuitBreaker
    at org.springframework.context.support.DefaultLifecycleProcessor.doStart(DefaultLifecycleProcessor.java:181) ~[spring-context-5.3.9.jar:5.3.9]
    at 

當我試圖運行我的Gateway應用程序時,我得到了以下錯誤,我也嘗試過將Spring cloud的版本更改為Hoxton.SR7,但它仍然不起作用。
請提供解決方案。另外,我已經實現了hystrix儀表板,但僅限于加載頁面。

推薦答案

與文檔https://cloud.spring.io/spring-cloud-gateway/reference/html/#spring-cloud-circuitbreaker-filter-factory所說的不同:

要啟用Spring Cloud斷路器過濾,您需要將spring-cloud-starter-circuitbreaker-reactor-resilience4j或Spring-cloud-starter-netflix-hystrix放在類路徑上。

用戶需要同時擁有兩個依賴項,才能自動配置以配置SpringCloudCircuitBreakerResilience4JFilterFactory Bean。

ie.
pom.xml:

<dependencies>
    <dependency>
        <groupId>org.springframework.cloud</groupId>
        <artifactId>spring-cloud-starter-gateway</artifactId>
    </dependency>

    <dependency>
        <groupId>org.springframework.cloud</groupId>
        <artifactId>spring-cloud-starter-circuitbreaker-reactor-resilience4j</artifactId>
    </dependency>

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

這是因為這個自動配置類的代碼:

@ConditionalOnClass({ DispatcherHandler.class,
        ReactiveResilience4JAutoConfiguration.class,
        HystrixCircuitBreakerAutoConfiguration.class })
public class GatewayCircuitBreakerAutoConfiguration {
and @ConditionalOnClass's

javadoc顯示:

必須存在的類。

因此,作為@ConditionalOnClass的列表參數列出的任何內容都是在AND關系中,而不是文檔聲稱的是或關系。

這篇關于找不到名為斷路器的GatewayFilterFactory的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,

分享到:
標簽:GatewayFilterFactory 名為 找不到 斷路器
用戶無頭像

網友整理

注冊時間:

網站:5 個   小程序:0 個  文章:12 篇

  • 51998

    網站

  • 12

    小程序

  • 1030137

    文章

  • 747

    會員

趕快注冊賬號,推廣您的網站吧!
最新入駐小程序

數獨大挑戰2018-06-03

數獨一種數學游戲,玩家需要根據9

答題星2018-06-03

您可以通過答題星輕松地創建試卷

全階人生考試2018-06-03

各種考試題,題庫,初中,高中,大學四六

運動步數有氧達人2018-06-03

記錄運動步數,積累氧氣值。還可偷

每日養生app2018-06-03

每日養生,天天健康

體育訓練成績評定2018-06-03

通用課目體育訓練成績評定