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

Servlet 3 asynchronous requests not correctly handled #2

Closed
c0nscience opened this issue Sep 22, 2015 · 7 comments
Closed

Servlet 3 asynchronous requests not correctly handled #2

c0nscience opened this issue Sep 22, 2015 · 7 comments
Labels

Comments

@c0nscience
Copy link

Hi,

we just tried your logging filter implementation, but it breaks all of our requests. Because we use exclusively servlet 3 async requests in our application, every request mapping method returns a callable.

Example method declaration:

public Callable<ResponseEntity<Entity>> getEntity(@RequestBody final dto)

The response is always missing the content type and body, with the logging filter enabled.

Any suggestions how to fix this problem?

@lukasniemeier-zalando
Copy link
Member

I haven't had the chance to look into a filter chain with async requests. Could you provide a failing test case?

@c0nscience
Copy link
Author

Thanks @lukasniemeier-zalando for the quick response.

I just created a small example project with a simple rest endpoint and the logging filter configured.
Have a look at https://github.com/c0nscience/async-logging-test

The junit test though succeeds, but you can see in the logs that the httpLogger of the filter does not log a content type nor the body. If you run the example with the filter enabled the response is empty and if disabled the response is correct.

Sorry for the form of the example, I didn't know a faster and easier solution.
I hope it helps a bit.

@lukasniemeier-zalando
Copy link
Member

Thank's for the test case. I think @whiskeysierra already tried out something promising 🕐

@rzimmer
Copy link

rzimmer commented Sep 29, 2015

Uh, that's great! Really looking forward to see async responses being logged! 👍

@whiskeysierra
Copy link
Collaborator

@rzimmer @c0nscience Can you try with org.zalando:logbook-servlet:0.1.0? We completely refactored the library and added support for async dispatch in the meantime.

@rzimmer
Copy link

rzimmer commented Oct 14, 2015

We had the chance to take a deeper look at the refactored library yesterday and so far, it looks really good. Async responses are logged correctly now with body messages. Until now, nothing seems broken.

Thanks for your effort, your quick reaction time and your greatly designed library, makes a lot of fun!

@whiskeysierra
Copy link
Collaborator

Glad to hear that it works for you.

We still have some TODOs on our wishlist for this, e.g. #17 (special setup for secure services) and I'm not 100% happy with the current separation of formatting and writing, but nothing concrete, more like a gut feeling.

andersjaensson pushed a commit to andersjaensson/logbook that referenced this issue Oct 10, 2022
…ient5

fix: Return raw query and actual reason phrase from server response
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants