[JERSEY-2324] Asynchronous ContainerRequestFilter using ManagedAsync - Java.net JIRA
A ContainerRequestFilter cannot be executed asynchronously.
A very common use case for this filter would be an authorization check, but if that check goes to an external service or to a database, benefits from @ManagedAsync are lost because only resource methods are invoked asynchronously.
This is very tricky because a PreMatching filter could change the request from a @ManagedAsync resource method to a non-async method, or visa-versa. Maybe any filters that are not PreMatching should be offloaded to the ExecutorService if the matching resource method has @ManagedAsync? Or maybe an entirely new type of filter should be introduced for this case, one that's basically an HK2 AOP MethodInterceptor?
Read full article from [JERSEY-2324] Asynchronous ContainerRequestFilter using ManagedAsync - Java.net JIRA
No comments:
Post a Comment