0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 1 year has passed since last update.

org.springframework.core.io.buffer.DataBufferのログ出力後、レスポンスボディが出力されない。

Posted at

目的

ログ出ししながら、FluxやMonoを返したい。

問題

DataBufferをログ出力すると、レスポンスボディが空になってしまった。

原因

DataBufferには読み出し位置が移動するため、

  • ログ出力
  • レスポンス

の2回出力を必要とする場合、dataBuffer.readPosition(0);の実行が必要。

対応

ログ出力後、dataBuffer.readPosition(0);を行い、後続処理へ渡せば良い。

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?