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
Provide a way to set a request timeout using annotation #4463
Comments
Would adding a new decorater that does ServiceRequestContext.setRequestTimeout(SET_FROM_START, ), then implementing the new @RequestTimeout with @DecoratorFactory be a viable solution for this issue? Though this would create dependency to the armeria decorator implementation, it would also allow us to use the annotation on other services (such as gRPC services) not only annotated services. If not so, I guess the annotation should be collected and acknowledged when ServiceConfig is created |
Nice 👏 😄 If not so, you could toss it to me 🙂 |
@j-min5u I haven't started working on it. It's all yours, thanks! |
Motivation: Provide a way to set a request timeout using annotation Modifications: - Add @interface RequestTimeout - Add RequestTimeoutDecoratorFunction Result: - Closes #4463 - users can use RequestTimeout annotation to set request timeout to service methods
The timeout of an annotated service could be set using AnnotatedServiceBindingBuilder.requestTimeoutMillis().
However, it is globally applied to all methods of the service. If users want to set a custom timeout, they have to call
ServiceRequestContext.setRequestTimeout()
manually in a service or decorator.It would be easy to set a timeout of a service or method if we introduce
@RequestTimeout
. For example:If both
AnnotatedServiceBindingBuilder.requestTimeout()
and@RequestTimeout()
is set, we can give priority to@RequestTimeout
.The text was updated successfully, but these errors were encountered: