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

Leverage Jackson non-blocking JSON parsing (and remove netty-buffer dependency) [SPR-14528] #19097

Closed
spring-issuemaster opened this Issue Jul 29, 2016 · 7 comments

Comments

Projects
None yet
2 participants
@spring-issuemaster
Copy link
Collaborator

spring-issuemaster commented Jul 29, 2016

Rossen Stoyanchev opened SPR-14528 and commented


Affects: 5.0 M1

Issue Links:

  • #19492 Support for Jackson 2.9 ("depends on")
  • #20349 WebClient fails on empty JSON array response
  • #20358 Parse error when reading JSON through the Jackson non-blocking parser
  • #19985 Add Jackson Smile support to WebFlux
  • #20107 Upgrade to Jackson 2.9 GA
@spring-issuemaster

This comment has been minimized.

Copy link
Collaborator Author

spring-issuemaster commented Aug 10, 2016

Sébastien Deleuze commented

Arjen Poutsma Rossen Stoyanchev I have created an updated JsonObjectDecoder based on our DataBuffer instead of using Netty ByteBuf, see this branch for the code. This is the first working version, and the implementation still needs some polish and managing properly buffer release/retain, but I think this is a good basis for discussing various points.

Please notice that I fixed a bug in NettyDataBuffer#lastIndexOf() to make it works.

This JsonObjectDecoder implementation aggregates the multiple buffers thanks to DataBuffer#write(DataBuffer), creates a slice in order to identify the JSON objects start and end index without changing the original buffer read position, and then return each JSON object as a slice that will be processed by Jackson2JsonDecoder.

I think I need Arjen Poutsma feedback to understand how to manage release/retain in that use cases, where we use slices and where 2 decoders are processing the data together.

@spring-issuemaster

This comment has been minimized.

Copy link
Collaborator Author

spring-issuemaster commented Mar 30, 2017

Sébastien Deleuze commented

Jackson 2.9 (initial release or a patch release coming shortly after) should provide asynchronous Jackson JSON parsing capabilities that will allow to avoid requiring io.netty.buffer dependency.

@spring-issuemaster

This comment has been minimized.

Copy link
Collaborator Author

spring-issuemaster commented Jun 5, 2017

Sébastien Deleuze commented

This feature should be available in the upcoming Jackson 2.9.0.pr4.

@spring-issuemaster

This comment has been minimized.

Copy link
Collaborator Author

spring-issuemaster commented Jun 17, 2017

Sébastien Deleuze commented

We now use Jackson 2.9.0.pr4 which contains this non-blocking JSON feature.

Arjen Poutsma Since you mention during last meeting that you want to have a look to this feature + you have the experience of implementing Aalto XML support, I assign you this issue. Feel free to assign back to me after your initial look if you don't have the time to handle it for RC3.

@spring-issuemaster

This comment has been minimized.

Copy link
Collaborator Author

spring-issuemaster commented Jun 28, 2017

Arjen Poutsma commented

Completed in 31e0e53

@spring-issuemaster

This comment has been minimized.

Copy link
Collaborator Author

spring-issuemaster commented Jun 29, 2017

Stéphane Nicoll commented

That commit added an import on org.eclipse.jetty.io.RuntimeIOException

@spring-issuemaster

This comment has been minimized.

Copy link
Collaborator Author

spring-issuemaster commented Jun 29, 2017

Stéphane Nicoll commented

Polished in b1f06fd

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment