Spring unable to decode aggregated JSON content #31747
Labels
in: web
Issues in web modules (web, webmvc, webflux, websocket)
status: backported
An issue that has been backported to maintenance branches
type: bug
A general bug
Milestone
Affects: Spring Framework 6.0.5+
Issue
Spring fails to decode a JSON payload whose content has been aggregated and represented by at least 2 DataBuffer components, causing the error below to be thrown. This happens only when we have a
HttpObjectAggregator
in the NettyChannelPipeline
and the content is transformed to aFlux
publisher, regardless of whether we block or not when retrieving the data.Even though this is a specific case where we are "bypassing" the reactive nature of WebClient, and I can workaround the issue, I see this as a bug. Please let me know if I am misusing the client and Spring is not supposed to support this use-case.
How to reproduce the issue
Sample Spring Boot project with a
data-source
application that serves the data and adata-client
application where the issue occurs while reading the data To reproduce this issue start both applications and invoke the/get-data-objects
endpoint on the client application.Minimal code
WebClient configuration.
Endpoint invocation.
Debugging
I suspect the issue was introduced with the changes to
org.springframework.http.codec.json.Jackson2Tokenizer
in #29943.The text was updated successfully, but these errors were encountered: