How to include the service's context-path when the gateway forwards requests

オープン
#4,102 コメント 1 件 リアクション 0 件 担当者 0 名 GitHub で見る

メンテナーはふだん 1 日以内に返信

まだ誰も着手していません。

評価

難易度
4/5
見積もり時間
3〜5日
初心者へのやさしさ
35/100
issue の種類
バグ
明瞭さ
おおむね明確
活発さ
停滞
技術スタック
java, spring-boot
領域
api, backend

調査の方向性

Spring Cloud Gateway WebFlux の discovery locator 設定とその urlExpression から始め、Nacos サービスのメタデータがルート構築にどのように公開されるかを調べます。登録された context path を自動的に読み取れるか確認し、手動で設定したルートなしで転送されたリクエストにそれが含まれることを確認します。

索引モデルが issue の本文から書いたものです。

説明

waiting-for-triage

Springcloud Version: 2025.0.1
spring-cloud-starter-gateway-server-webflux: 4.3.3
nacos server: 3.0.3

Configuration as follows
spring: jackson: date-format: yyyy-MM-dd HH:mm:ss time-zone: GMT+8 cloud: gateway: server: webflux: discovery: locator: enabled: true lowerCaseServiceId: true # urlExpression: "'lb://' + serviceId + metadata['contextPath']"
Even if urlExpression is configured
Still unable to forward with context path
So how should I configure it ?
My idea is if there is any configuration where I can directly read the context path value in the metadata of the Nacos service registration information, so that I don't need to manually configure the routing

主要言語
Java
スター
4.9k
フォーク
3.5k
平均マージ
1日 13時間
マージ済み PR(30日)
14

環境構築

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

spring-cloud/spring-cloud-gateway のほかの issue

spring-cloud/spring-cloud-gateway の issue をすべて見る

似ている issue

Java の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。