-
Notifications
You must be signed in to change notification settings - Fork 38k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add decodeDataBuffer to Decoder and encodeValue to Encoder #22782
Comments
This change breaks API compatibility of Encoder, Decoders writen against previous Spring versions.
|
For For |
This caused some massive headaches on our end. Breaking changes like that should be noted in the release notes--can we update those to reflect that? |
I guess the right place to make a note would be the wiki page -- I don't think I have edit access but maybe someone can make that note for 5.2? |
@seantsb are you referring to the |
yep exactly; and more specifically that it will break existing implementations when doing the minor version upgrade to 5.2 |
Done. |
should it be under 5.2 instead? |
Yes it should be, thank you. |
Thank you! |
In some protocols (HTTP, TCP) the stream of bytes needs to be parsed to be decoded and likewise chunks of encoded content can written out. In other protocols (e.g. RSocket, WebSocket) input and output streams are already split into discrete messages so that each
DataBuffer
can be decoded and is encoded in full.Currently
Encoder
andDecoder
contracts are good the former but unnecessarily cumbersome requiring to wrapping in aMono
and joining withDataBufferUtils
. Even in WebFlux there are plenty of cases where we've run into this (multipart, form data, etc). We should adddecodeDataBuffer
toDecoder
andencodeValue
inEncoder
.Sub-classes of
AbstractDataBufferDecoder
already have a protecteddecodeDataBuffer
method that does this (on joined buffers). I suspect Jackson and Jaxb2 implementations of decodeToMono could also skip the asynchronous parsing for decoding toMono
and extend this class, see #22783. Likewise Encoder implementations either have methods for encoding one value, or could benefit from one.The text was updated successfully, but these errors were encountered: