gateway 网关 路由新增 (已亲测)

问题:

前端通过gateway调用后端接口,路由转发失败,提示404 not found

排查:

使用 { "href":"/actuator/gateway/routes", "methods": "POST", "GET" } 命令查看路由列表,确实缺少路由信息

curl -v http://127.0.0.1:9090/actuator/gateway/routes >> 123.txt

输出到 123.txt 文件

处理方式:

1、 手动刷新

{ "href":"/actuator/gateway/refresh", "methods": "POST" }

2、 手动添加

{ "href":"/actuator/gateway/routes/route-id-1", "methods": "POST", "DELETE", "GET" }

官方说明:

To create a route definition, make a POST request to /gateway/routes/{id_route_to_create} with a JSON body that specifies the fields of the route (see Retrieving Information about a Particular Route).

To delete a route definition, make a DELETE request to /gateway/routes/{id_route_to_delete}.

官网地址:
Spring Cloud Gateway

操作截图:

相关推荐
程序员清风9 小时前
Portkey AI Gateway 实战:构建可治理的多模型网关
人工智能·gateway
JJJennie7779 小时前
大模型网关能做故障转移吗?MAI Gateway如何赋能企业AI能力
ai·gateway·ai网关·企业网关
Raas1008 天前
MAI Gateway(魔芋企业级AI网关)功能全解:AI网关支持流式输出吗?一文看懂AI网关能力矩阵
大数据·人工智能·gateway·mai gateway·企业级网关
毅炼9 天前
不写多语言 SDK,怎么让 Python、Go、Node 服务接入注册中心?
java·后端·系统架构·gateway
Raas10012 天前
AI网关支持哪些模型?MAI Gateway(魔芋企业级AI网关)功能实测与最佳实践
大数据·人工智能·gateway·mai gateway·企业级产品
Raas10012 天前
MAI Gateway(魔芋企业级AI网关)技术揭秘:AI网关支持DeepSeek吗?从原理到落地
大数据·人工智能·gateway·ai网关·mai gateway·魔芋·企业级产品
Raas10013 天前
MAI Gateway(魔芋企业级AI网关)技术揭秘:AI网关支持哪些模型?从原理到落地
大数据·人工智能·网关·gateway·mai gateway·企业级产品
多云行者13 天前
什么是LLM Gateway?定义、技术栈与落地方式详解
网关·llm·gateway·api·传统
毅炼14 天前
Rover-Suite 开源发布:轻量服务注册中心与网关一体化方案
java·后端·系统架构·gateway