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

Support Smile streaming in WebFlux [SPR-16151] #20699

Closed
spring-issuemaster opened this Issue Nov 2, 2017 · 6 comments

Comments

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

spring-issuemaster commented Nov 2, 2017

Benoit LEPREVOST opened SPR-16151 and commented

See issue raised initialy on spring-boot: spring-projects/spring-boot#10756

Jackson2SmileEncoder/Decoder declare "stream+x-jackson-smile" as a streaming MediaType, it doesn't seem to work by default. In my use case, we need binary encoding as we pass a lot a matrices and json just doesn't perform well for that case. CBOR would also be nice, if it came with a streaming option.

I've attached a new sample project.

Thank you


Affects: 5.0.1

Attachments:

Referenced from: commits 31b25b5, 32f6cce

@spring-issuemaster

This comment has been minimized.

Copy link
Collaborator Author

spring-issuemaster commented Nov 21, 2017

Sébastien Deleuze commented

I have begin working on a fix (see this draft commit) but I am not 100% yet Smile stream non-blocking parsing is fully supported on Jackson and WebFlux codecs side.
I need to ask confirmation to the Jackson project lead, add integration tests, and review these changes with Arjen Poutsma, so let's plan that for 5.0.3.

@spring-issuemaster

This comment has been minimized.

Copy link
Collaborator Author

spring-issuemaster commented Dec 18, 2017

Sébastien Deleuze commented

I have updated the branch which now contains the following changes:

  • Move getDecodableMimeTypes() to AbstractJackson2Decoder
  • Move getEncodableMimeTypes() to AbstractJackson2Encoder
  • Add support for application/stream+x-jackson-smile
  • Remove streaming line separator when pretty print is enabled or Smile encoder is used

Currently there is a low level error thrown by Jackson in JacksonStreamingIntegrationTests:
JsonParseException: Still have 13 undecoded bytes, should not call 'feedInput'
Point has been raised on Jackson side, waiting for a feedback.

@spring-issuemaster

This comment has been minimized.

Copy link
Collaborator Author

spring-issuemaster commented Dec 18, 2017

Sébastien Deleuze commented

I have created a dedicated issue on Jackson side: FasterXML/jackson-dataformats-binary#127

@spring-issuemaster

This comment has been minimized.

Copy link
Collaborator Author

spring-issuemaster commented Jan 8, 2018

Sébastien Deleuze commented

I have moved this issue to 5.0.4 since Jackson issue is not fixed yet.

@spring-issuemaster

This comment has been minimized.

Copy link
Collaborator Author

spring-issuemaster commented Jan 12, 2018

Sébastien Deleuze commented

I have provided a repro project as requested by Tatu. It should allow him to see if the issue is on Jackson side or in our Jackson2Tokenizer.

@spring-issuemaster

This comment has been minimized.

Copy link
Collaborator Author

spring-issuemaster commented Jan 27, 2018

Sébastien Deleuze commented

Tatu provided guidance that should allow us to update our implementation in order to make it work with Smile streaming (since it is not exactly the same than JSON).

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