-
Notifications
You must be signed in to change notification settings - Fork 0
Add armeria decorators #25
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
src/main/java/com/fluxninja/aperture/armeria/DecoratingHTTPClient.java
Outdated
Show resolved
Hide resolved
| try { | ||
| res = unwrap().execute(ctx, req); | ||
| flow.end(FlowStatus.OK); | ||
| } catch (InterruptedException | ApertureSDKException e) { |
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.
What is InterruptedException?
When does ApertureSDKException happen?
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.
Not sure what was the reasoning behind InterruptedException, removed it for now;
ApertureSDKException in this case can happen when trying to end a flow that was already ended.
src/main/java/com/fluxninja/aperture/armeria/DecoratingHTTPClient.java
Outdated
Show resolved
Hide resolved
| return res; | ||
| } else { | ||
| try { | ||
| flow.end(FlowStatus.Error); |
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.
The argument to flow.end is supposed to represent errors in feature execution. Can leave it unset in the scenario where flow is not accepted by Aperture I.E. Feature/Server handler did not run
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.
the FlowStatus accepted as argument is an enum, so one of the possible values has to be passed; Shall we add a third value, other than "OK" and "Error"?
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.
Sure, call it Unset
| } catch (ApertureSDKException e) { | ||
| e.printStackTrace(); | ||
| } | ||
| return HttpResponse.of(HttpStatus.BAD_REQUEST); |
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.
Need to set response code based on CheckResponse.RejectReason
429 Too many requests in case of REJECT_REASON_RATE_LIMITED
503 Service unavailable in case of REJECT_REASON_CONCURRENCY_LIMITED
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.
Should we also use http codes for RPC responses?
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.
Return an execptionally completed response? https://javadoc.io/doc/com.linecorp.armeria/armeria-javadoc/latest/com/linecorp/armeria/common/RpcResponse.html
src/main/java/com/fluxninja/aperture/armeria/DecoratingHTTPService.java
Outdated
Show resolved
Hide resolved
src/main/java/com/fluxninja/aperture/armeria/DecoratingRPCClient.java
Outdated
Show resolved
Hide resolved
f41b4fd to
36980e6
Compare
890610c to
bbba279
Compare
kwapik
left a comment
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.
Reviewed 14 of 14 files at r2, all commit messages.
Reviewable status: all files reviewed, 7 unresolved discussions (waiting on @IridiumOxide and @tanveergill)
This change is