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

GZIP doesnt work when rest controller return a callable #854

Closed
tofmonaute opened this issue Dec 8, 2014 · 4 comments
Closed

GZIP doesnt work when rest controller return a callable #854

tofmonaute opened this issue Dec 8, 2014 · 4 comments
Milestone

Comments

@tofmonaute
Copy link

GZIP filter seems configured for async however when my controller return a Callable:
code of the method:
@RequestMapping(method = RequestMethod.PUT, value="/rest/voitures/{voitureId}", consumes="application/json; charset=utf-8", produces = MediaType.APPLICATION_JSON_VALUE)
public Callable voitureUpdate(@RequestBody final Voiture v, @PathVariable("voitureId") final Long voitureId) {
return new Callable() {
override
public Voiture call() throws Exception {
log.debug("REST request to update Voiture : {}", v);
Voiture voiture2Update = voitureRepository.findOne(voitureId);
voitureRepository.save(v);
return v; } }; }

The following Exception is thrown:
[ERROR] org.apache.catalina.core.ContainerBase.[Catalina].[localhost].[/jhipster].[dispatcherServlet] - "Servlet.service()" pour la servlet dispatcherServlet a lancé une exception
java.io.IOException: write beyond end of stream
at java.util.zip.DeflaterOutputStream.write(DeflaterOutputStream.java:201) ~[na:1.7.0_55]
at java.util.zip.GZIPOutputStream.write(GZIPOutputStream.java:146) ~[na:1.7.0_55]
at java.io.FilterOutputStream.write(FilterOutputStream.java:97) ~[na:1.7.0_55]

@jmirc
Copy link
Member

jmirc commented Dec 12, 2014

I spend times on it and I didn't find a solution. The DeflaterOutputStream class doesn't support async call and I didn't find an implementation of an asyncGzipFilter class.

@tofmonaute
Copy link
Author

Thank you for this answer Jérôme

2014-12-12 11:59 GMT+01:00 Jérôme Mirc notifications@github.com:

I spend times on it and I don't find a solution. Actually the
DeflaterOutputStream doesn't support async and I didn't find an
implementation of an asyncGzipFilter class.


Reply to this email directly or view it on GitHub
#854 (comment)
.

@jmirc
Copy link
Member

jmirc commented Dec 12, 2014

So, if you want to use async call, you need to disable the gzip filter.

@jdubois
Copy link
Member

jdubois commented Dec 22, 2014

I'm closing this as we don't have a solution, but I would of course like to find a better option!

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

No branches or pull requests

3 participants