服务网关GateWay的错误解决方法

错误集合

1、java.lang.IllegalStateException: Invalid host: lb://order_service


java.lang.IllegalStateException: Invalid host: lb://order_service
	at org.springframework.cloud.gateway.filter.RouteToRequestUrlFilter.filter(RouteToRequestUrlFilter.java:86) ~[spring-cloud-gateway-server-2.2.6.RELEASE.jar:2.2.6.RELEASE]
spring:
  application:
    name: geteway_8002
  cloud:
    gateway:
      routes:
        - id: order_route
          uri: lb://order_service   #这个是注册中心的服务名
          predicates:
            - Path=/order/**
          filters:
            - StripPrefix=1
服务名不可以用下划线_  应该用uri:uri: lb://orderService 
上一篇:基于PYTHON调用阿里云分割抠图-商品分割接口


下一篇:使用nginx反向代理后端服务,实现负载均衡