Skip to content
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-projects-issues opened this issue Jul 29, 2016 · 7 comments
Assignees
Labels
in: web Issues in web modules (web, webmvc, webflux, websocket) type: task A general task
Milestone

Comments

@spring-projects-issues
Copy link
Collaborator

spring-projects-issues commented Jul 29, 2016

Rossen Stoyanchev opened SPR-14528 and commented


Affects: 5.0 M1

Issue Links:

@spring-projects-issues
Copy link
Collaborator Author

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-projects-issues
Copy link
Collaborator Author

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-projects-issues
Copy link
Collaborator Author

Sébastien Deleuze commented

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

@spring-projects-issues
Copy link
Collaborator Author

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-projects-issues
Copy link
Collaborator Author

Arjen Poutsma commented

Completed in 31e0e53

@spring-projects-issues
Copy link
Collaborator Author

Stéphane Nicoll commented

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

@spring-projects-issues
Copy link
Collaborator Author

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
Labels
in: web Issues in web modules (web, webmvc, webflux, websocket) type: task A general task
Projects
None yet
Development

No branches or pull requests

2 participants