-
Notifications
You must be signed in to change notification settings - Fork 916
Add support for event stream requests over RPC #2388
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
Codecov Report
@@ Coverage Diff @@
## master #2388 +/- ##
============================================
- Coverage 77.69% 77.63% -0.07%
Complexity 366 366
============================================
Files 1245 1247 +2
Lines 39294 39369 +75
Branches 3106 3112 +6
============================================
+ Hits 30531 30563 +32
- Misses 7277 7315 +38
- Partials 1486 1491 +5
Flags with carried forward coverage won't be shown. Click here to find out more.
Continue to review full report at Codecov.
|
@rschmitt Awesome! Appreciate the contribution. We will need schedule some time on our side to review this so there will be a delay, but we'll have a look soon. |
bcf7e77
to
b91234d
Compare
core/aws-core/src/main/resources/software/amazon/awssdk/global/handlers/execution.interceptors
Show resolved
Hide resolved
00f890a
to
3232587
Compare
I think for this change, it makes sense to add some codegen reftests, just to make sure we're actually generating things like Line 27 in a402b40
|
.../sdk-core/src/main/java/software/amazon/awssdk/core/internal/async/AsyncStreamPrepender.java
Outdated
Show resolved
Hide resolved
...in/java/software/amazon/awssdk/awscore/eventstream/EventStreamInitialRequestInterceptor.java
Outdated
Show resolved
Hide resolved
I think ideally, we'd leverage the marshallers to marshall the request directly to a suitable |
Integ tests seem to be failing. Can you take a look? Locally, I'm seeing
|
7049cc1
to
10226de
Compare
I wasn't immediately able to reproduce this particular failure.
|
10226de
to
5baf8c2
Compare
It looks like the JSON tests are actually |
5baf8c2
to
09afe78
Compare
Codecov Report
@@ Coverage Diff @@
## master #2388 +/- ##
============================================
+ Coverage 77.71% 77.76% +0.04%
Complexity 366 366
============================================
Files 1247 1249 +2
Lines 39471 39569 +98
Branches 3088 3099 +11
============================================
+ Hits 30675 30769 +94
- Misses 7311 7314 +3
- Partials 1485 1486 +1
Flags with carried forward coverage won't be shown. Click here to find out more.
Continue to review full report at Codecov.
|
6ebdcb0
to
eaa1eba
Compare
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.
LGTM overall!
...ore/src/test/java/software/amazon/awssdk/core/internal/async/AyncStreamPrependerTckTest.java
Show resolved
Hide resolved
This commit adds support for RPC services that use client->server or bidirectional event streaming. In the RPC formats (i.e. AWS JSON), the marshalled request and response objects are sent as the first event in the request and response stream respectively. This is different from the REST formats, such as REST JSON, which bind the request and response fields to non-payload positions (headers, URI, method, status code, query string) when event streaming is used. The implementation of this feature is mainly performed by a new global interceptor, `EventStreamInitialRequestInterceptor`. The interceptor detects when an `initial-request` event needs to be sent and transforms the async response body by constructing the `initial-request` message and prepending it to the event stream. Due to the high precedence of global interceptors, any subsequent service or override interceptors that run on the body will see the transformed version. This also applies to the `EventStreamAws4Signer`, which will produce a signature over the `initial-request` event.
eaa1eba
to
94cc4cc
Compare
Kudos, SonarCloud Quality Gate passed! |
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.
…f143a87fb Pull request: release <- staging/49d2e997-95f3-4a8c-b933-d1af143a87fb
This commit adds support for RPC services that use client->server or
bidirectional event streaming. In the RPC formats (i.e. AWS JSON), the
marshalled request and response objects are sent as the first event in
the request and response stream respectively. This is different from the
REST formats, such as REST JSON, which bind the request and response
fields to non-payload positions (headers, URI, method, status code,
query string) when event streaming is used.
The implementation of this feature is mainly performed by a new global
interceptor,
EventStreamInitialRequestInterceptor
. The interceptordetects when an
initial-request
event needs to be sent and transformsthe async response body by constructing the
initial-request
messageand prepending it to the event stream. Due to the high precedence of
global interceptors, any subsequent service or override interceptors
that run on the body will see the transformed version. This also applies
to the
EventStreamAws4Signer
, which will produce a signature over theinitial-request
event.I confirm that this pull request can be released under the Apache 2 license.