团队协作之动态网关问题1

Blade 未结 2 1362
jmx
jmx 剑圣 2020-08-18 20:04

一、该问题的重现步骤是什么?

  1. 团队协作之动态网关,如果直接从网关的项目接口,是没有问题的。走的是本机的服务,但是存在Feign调用的情况下,还是调不到本机的服务啊,怎么处理?

  2. 网关,desk,auth,user,system,gateway的启动类都加上了“-Chill”,然后启动了。

  3. 配置如下:

[

{

"id": "desk-route",

"order": 0,

"predicates": [

{

"name": "Path",

"args": {

"pattern": "/blade-desk/**"

}

}

],

"filters": [],

"uri": "lb://blade-desk-Chill"

},

{

"id": "auth-route",

"order": 0,

"predicates": [

{

"name": "Path",

"args": {

"pattern": "/blade-auth/**"

}

}

],

"filters": [],

"uri": "lb://blade-auth-Chill"

},

{

"id": "user-route",

"order": 0,

"predicates": [

{

"name": "Path",

"args": {

"pattern": "/blade-user/**"

}

}

],

"filters": [],

"uri": "lb://blade-user-Chill"

},

{

"id": "system-route",

"order": 0,

"predicates": [

{

"name": "Path",

"args": {

"pattern": "/blade-system/**"

}

}

],

"filters": [],

"uri": "lb://blade-system-Chill"

},

{

"id": "example-route",

"order": 0,

"predicates": [{

"name": "Path",

"args": {

"pattern": "/example"

}

}],

"filters": [],

"uri": "http://www.example.com"

}

]


2条回答
  • 2020-08-19 15:15

    那我服务之间调用Feign 也不走gateway啊


    作者追问:2020-08-20 10:30

    feign的地址配置了服务名,当然会走gateway

    1 讨论(0)
  • 目前团队协作有新的插件,推荐使用Ribbon负载组件,可以不改服务名直接指定网关优先调用的服务ip段,具体参考如下

    image.png

    0 讨论(0)
提交回复