-
Notifications
You must be signed in to change notification settings - Fork 827
JAV-355 Extract rest invocation #161
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
Conversation
for (HttpServerFilter filter : httpServerFilters) { | ||
Response response = filter.afterReceiveRequest(invocation, requestEx); | ||
if (response != null) { | ||
sendResponseQuietly(response); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it looks like the filter could hijack the response message which calling the doInvoke method.
I don't think it's good idea, there are too much assumption.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if user decided to break the filter chain, and direct send response, user return a Response.
if do not do like this, we need to build another mechanism like handler chain or some api to send response, it's too complex.
what's your suggestion?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please add some comments in the HttpServerFilter.afterReceiveRequst, to make sure user know about this kind of feature.
We still need to make sure the doInvoke() is called in the invoke method, no matter what kind of HttpServerFilter is used.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
OK.
import io.servicecomb.swagger.invocation.Response; | ||
import io.servicecomb.swagger.invocation.exception.InvocationException; | ||
|
||
public class AbstractRestServer { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is it safe to remove the AbstractRestServer?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this is our internal class, not a interface to developers
No description provided.