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

AbstractCodecConfigurer creates Jackson Encoders/Decoders each time when getters are called [SPR-15816] #20371

Closed
spring-projects-issues opened this issue Jul 25, 2017 · 1 comment
Assignees
Labels
in: web type: bug
Milestone

Comments

@spring-projects-issues
Copy link
Collaborator

spring-projects-issues commented Jul 25, 2017

Babur Duisenov opened SPR-15816 and commented

AbstractCodecConfigurer #getReaders #getWriters methods create new instances of Jackson2JsonDecoder and Jackson2JsonEncoder each time when getters are called, by default.
This happens because of this code:

protected Jackson2JsonEncoder jackson2Encoder() {
     return this.jackson2Encoder != null ? this.jackson2Encoder : new Jackson2JsonEncoder();
}
protected Jackson2JsonDecoder jackson2Decoder() {
     return this.jackson2Decoder != null ? this.jackson2Decoder : new Jackson2JsonDecoder();
}

The Jackson2JsonDecoder and Jackson2JsonEncoder internally are using org.springframework.util.ClassUtils.forName blocking method, which leads to blocking reactor-http-nio threads.


Affects: 5.0 RC2

Attachments:

Issue Links:

Referenced from: commits f397577

@spring-projects-issues
Copy link
Collaborator Author

spring-projects-issues commented Jul 26, 2017

Arjen Poutsma commented

Fixed in f397577

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
in: web type: bug
Projects
None yet
Development

No branches or pull requests

2 participants