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

Do not use Jackson2JsonEncoder for byte array [SPR-14825] #19391

Closed
spring-projects-issues opened this issue Oct 19, 2016 · 2 comments
Closed

Do not use Jackson2JsonEncoder for byte array [SPR-14825] #19391

spring-projects-issues opened this issue Oct 19, 2016 · 2 comments

Comments

@spring-projects-issues
Copy link
Collaborator

@spring-projects-issues spring-projects-issues commented Oct 19, 2016

Violeta Georgieva opened SPR-14825 and commented

Hi,

I have the following example

@RestController
public class TestController {

	private final Random rnd = new Random();

	@GetMapping(path = "/performance")
	Flux<byte[]> test() {
		byte[] content = new byte[16384];
		rnd.nextBytes(content);
		return Flux.just(content, content, content, content, content);
	}

}

org.springframework.http.codec.json.Jackson2JsonEncoder is used to encode the value which affects the response time.
It will be better if we do not use org.springframework.http.codec.json.Jackson2JsonEncoder for byte arrays.

Regards,
Violeta


Affects: 5.0 M2

@spring-projects-issues
Copy link
Collaborator Author

@spring-projects-issues spring-projects-issues commented Oct 19, 2016

Rossen Stoyanchev commented

Yes we need a byte[] message writer and/or expand on the the existing one that supports ByteBuffer.

@spring-projects-issues
Copy link
Collaborator Author

@spring-projects-issues spring-projects-issues commented Oct 21, 2016

Rossen Stoyanchev commented

There is a now a ByteArrayEncoder/Decoder.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
2 participants