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

Document how HandlerInterceptor should differentiate an ASYNC dispatch [SPR-12608] #17209

Closed
spring-issuemaster opened this issue Jan 9, 2015 · 3 comments

Comments

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

commented Jan 9, 2015

Francisco Lozano opened SPR-12608 and commented

HandlerIntercetor#preHandle is invoked twice in an async scenario.

The problem is that it's not documented how to differentiate and avoid double-executing some logic. As it's a very common problem when using interceptors and using async handling, adding some explicit doc about how to handle would help.

if (DispatcherType.ASYNC.equals(request.getDispatcherType())) {
          return true;                
}
doStuffAsUsual();
return whatever;

Affects: 4.1.4

Reference URL: https://github.com/flozano/spring-interceptor-async-test

Issue Links:

  • #16826 HTTP Streaming and Server-Sent Events (SSE)
  • #17317 Document how HandlerInterceptor can hook into async request timedout

Referenced from: commits 1803978

@spring-issuemaster

This comment has been minimized.

Copy link
Collaborator Author

commented Jan 9, 2015

Rossen Stoyanchev commented

Yes that would be very helpful for explaining the whole lifecycle of an async request. We are also expanding async request handling with Server-Sent Event support and HTTP streaming (#16826) so these two can be handled together.

@spring-issuemaster

This comment has been minimized.

Copy link
Collaborator Author

commented Mar 20, 2015

@spring-issuemaster

This comment has been minimized.

Copy link
Collaborator Author

commented Mar 20, 2015

Rossen Stoyanchev commented

Modified title (was: "Document better how to handle double-invocation of HandlerInterceptor#preHandle in async requests").

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.