Feign mixing up two separate request/response within the same client
メンテナーはふだん 1 日以内に返信
まだ誰も着手していません。
評価
- 難易度
- 4/5
- 見積もり時間
- 3〜5日
- 初心者へのやさしさ
- 30/100
- issue の種類
- バグ
- 明瞭さ
- 説明が足りない
- 活発さ
- 停滞
- 技術スタック
- java, spring-boot
調査の方向性
まず PlaceholderResource Feign interface と FeignConfiguration から始め、次にレポートに示されている同時リクエストのログ、URL、correlation ID を比較します。完了条件は、リクエスト間でレスポンスが取り違えられる現象を再現し、ある API 呼び出しのレスポンスを別の API 呼び出しに返している Feign コンポーネントまたは設定を特定することです。
索引モデルが issue の本文から書いたものです。
説明
Hi
I have been using feign for calls from one spring boot application to another in an infrastructure which has a large volume of API calls. Recently I have been getting an intermittent issue which says that the response received to one of the feign client calls cannot be resolved to the Object that it expects. Upon further debugging, I saw that the response received on this feign call is an unexpected response as it is supposed to be received on a completely different feign call.
Feign logs:
Jul 5, 2023 @ 18:33:44.518 [PlaceholderResource#getPlaceholderType] ---> GET http://placeholder-url.com/v5/getplaceholdertype/123/type/1234 HTTP/1.1
Jul 5, 2023 @ 18:33:44.518 [PlaceholderResource#getPlaceholderType] X-MM-CORRELATION-ID: correlation-id-1
Jul 5, 2023 @ 18:33:44.518 [PlaceholderResource#getPlaceholderType] ---> END HTTP (0-byte body)
Jul 5, 2023 @ 18:33:44.518 [PlaceholderResource#getPlaceholderType] <--- HTTP/1.1 200 OK (0ms)
Jul 5, 2023 @ 18:33:44.518 [PlaceholderResource#getPlaceholderType] content-type: application/json
Jul 5, 2023 @ 18:33:44.518 [PlaceholderResource#getPlaceholderType] link: <http://placeholder-url.com/v5/api/getplaceholderobject/123/user/123123/placeholderobject?param1=123123¶m2=true¶m3=false&page=-1&size=100>; rel="last" <http://placeholder-url.com/v5/api/getplaceholderobject/123/user/123123/placeholderobject?param1=123123¶m2=true¶m3=false&page=-1&size=100>; rel="first"
Jul 5, 2023 @ 18:33:44.519 [PlaceholderResource#getPlaceholderType] vary: accept-encoding
Jul 5, 2023 @ 18:33:44.519 [PlaceholderResource#getPlaceholderType] x-mm-correlation-id: correlation-id-2
Jul 5, 2023 @ 18:33:44.518 [PlaceholderResource#getPlaceholderType] date: Wed 05 Jul 2023 14:33:34 GMT
Jul 5, 2023 @ 18:33:44.519 [PlaceholderResource#getPlaceholderType] x-total-count: 0
Jul 5, 2023 @ 18:33:44.519 [PlaceholderResource#getPlaceholderType] x-result-count: 0-0/0
Jul 5, 2023 @ 18:33:44.519 [PlaceholderResource#getPlaceholderType] []
Jul 5, 2023 @ 18:33:44.519 [PlaceholderResource#getPlaceholderType] <--- END HTTP (2-byte body)
Jul 5, 2023 @ 18:33:44.519 [PlaceholderResource#getPlaceholderType]
The URL returned in the link header is sent back from a different URL used for getPlaceholderObjects API and not the getPlaceholderType API
This [] response is expected for the getPlaceholderObjects API. Even the correlation ID header we're receiving is for a different API call which is supposed to be running in a different thread.
Feign interface:
@FeignClient(
name = "placeholderResource",
url = "${placeholder.api.url}")
@Headers("Content-Type: application/json")
public interface PlaceholderResource {
/**
* Get placeholder type
*/
@GetMapping(
value = "/getplaceholdertype/{referrerId}/type/{placeholderTypeId}")
PlaceholderType getPlaceholderType(@PathVariable("referrerId") final Integer referrerId,
@PathVariable("placeholderTypeId") final Long placeholderTypeId);
/**
* Get placeholder object(s)
*/
@GetMapping(
value = "/getplaceholderobject/{referrerId}/user/{userId}/placeholderobject")
PlaceholderObject[] getPlaceholderObjects(@PathVariable("referrerId") final Integer referrerId,
@PathVariable("userId") final Long userId,
@RequestParam("param1") final List<Long> param1,
@RequestParam("param2") final String param2,
@RequestParam("param3") final Boolean param3);
}
Feign configuration:
/**
* Configuration class for feign client(s).
*/
@Configuration
@EnableDiscoveryClient
public class FeignConfiguration {
@Bean
public FeignClientEncodingProperties feignClientEncodingProperties() {
return new FeignClientEncodingProperties();
}
@Bean
public ErrorDecoder feignErrorDecoder() {
return new CustomFeignErrorDecoder();
}
}
- 主要言語
- Java
- スター
- 9.8k
- フォーク
- 2k
- 平均マージ
- 1時間 23分
- マージ済み PR(30日)
- 31
環境構築
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートなし
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
OpenFeign/feign のほかの issue
-
DefaultAsyncClient never completes the returned future when Client throws Error対応中かも @hutiefang76 が 20 日前に担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100
メンテナーはふだん 1 日以内に返信
-
Response.charset ignores charset after another Content-Type parameter対応中かも @hutiefang76 が 20 日前に担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100
メンテナーはふだん 1 日以内に返信
-
UriUtils ignores allowReservedCharacters=false when the input has no percent triplet対応中かも @hutiefang76 が 20 日前に担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
メンテナーはふだん 1 日以内に返信
-
Java11 Http2Client loses response header value order and duplicate occurrences対応中かも @hutiefang76 が 19 日前に担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 35/100
メンテナーはふだん 1 日以内に返信
-
Java11 Http2Client rejects documented zero connect and read timeouts対応中かも @hutiefang76 が 19 日前に担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 35/100
メンテナーはふだん 1 日以内に返信
OpenFeign/feign の issue をすべて見る
似ている issue
-
Document and enforce pull request review guidelines対応中かも @dashorst が今日担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100
メンテナーはふだん 1 日以内に返信
-
`Time.at(t, in: nil)` returns UTC instead of the local time (or the time zone of `t`), unlike CRubyオープン
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
メンテナーはふだん 1 日以内に返信
-
hermes-queue
難易度 1/5 1時間未満 初心者へのやさしさ 72/100
chrisalunlloyd2-sudo/mindpalace#349 ·
メンテナーはふだん 1 日以内に返信
-
Retry-After parser accepts invalid delay-seconds values対応中かも @Dhruvraj-Rana が今日担当しました。 オープンBug
難易度 2/5 1〜3時間 初心者へのやさしさ 82/100
open-telemetry/opentelemetry-java#9018 ·
メンテナーはふだん 2 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
dropwizard/dropwizard#11410 ·
メンテナーはふだん 1 日以内に返信