-
Notifications
You must be signed in to change notification settings - Fork 221
Add http-1x examples for server SDK usage #4377
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
base: feature/http-1.x
Are you sure you want to change the base?
Conversation
This commit updates examples to demonstrate server SDK usage with both [email protected] and [email protected], supporting the http-1x migration effort. ## Changes ### New Directories - **legacy/**: Complete set of examples using [email protected]/[email protected] with aws-smithy-legacy-http-server. These examples preserve the original behavior for users not yet ready to migrate. - **pokemon-service-server-skd-patch/**: Compatibility layer and patches for bridging http@0 and http@1 types in server SDK. ### Updated Examples Modified existing examples to use [email protected]/[email protected]: - pokemon-service: Main service example updated for http@1 - pokemon-service-tls: TLS example with hyper 1.x compatibility - pokemon-service-lambda: Lambda example updated for http@1 - pokemon-service-client-usage: Client examples updated - pokemon-service-common: Common utilities updated ### Key Updates - Cargo.toml files updated with [email protected] and [email protected] dependencies - Server initialization code updated for hyper 1.x API changes - Test helpers updated to support both HTTP versions - Connector and middleware examples updated for new hyper API Relates to #3362
Provides detailed migration instructions for upgrading from [email protected]/[email protected] to [email protected]/[email protected] including: - Dependency updates - Server initialization changes - Client connector setup - Test infrastructure improvements - Common patterns and troubleshooting - Complete migration checklist
examples/upgrade-http1x.md
Outdated
|
|
||
| ## Why Upgrade? | ||
|
|
||
| - **Better Performance**: Hyper 1.x has improved performance and reduced allocations |
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 this actually true?
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.
Ops! I had completely forgotten to review the file before pushing the commit - sorry.
| - **Ecosystem Alignment**: New libraries are targeting [email protected] and [email protected] | ||
| - **Security Updates**: Continued security patches for 1.x line |
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.
these are the actual reasons
examples/upgrade-http1x.md
Outdated
|
|
||
| **After:** | ||
| ```rust | ||
| use http::StatusCode; |
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.
can we re-export this from the server or aws-smithy-http-server? I don't see any compelling reason to force a direct http dep.
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 is being re-exported from the aws-smithy-http-server: rust-runtime/aws-smithy-http-server/src/lib.rs.
Need to change the guide.
| ## Client-Side Changes | ||
|
|
||
| ### HTTP Client Connector Setup |
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 call out that client/server http versions are totally decoupled.
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.
I need to check with the SDK team on this section. For the time being I am removing it.
examples/upgrade-http1x.md
Outdated
| ### 3. Request Handling | ||
|
|
||
| Most request handling code remains the same thanks to smithy-rs abstractions: | ||
|
|
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.
probably no need to bother calling this out.
| @@ -0,0 +1,54 @@ | |||
| // Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. | |||
| #[allow(clippy::unnecessary_wraps)] | |||
| pub async fn de_check_health_http_request<B>( | |||
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.
I don't think you meant to check in this entire directory
This commit updates examples to demonstrate server SDK usage with both [email protected]
and [email protected], supporting the http-1x migration effort.
Changes
New Directories
legacy/: Complete set of examples using [email protected]/[email protected] with
aws-smithy-legacy-http-server. These examples preserve the original behavior
for users not yet ready to migrate.
pokemon-service-server-skd-patch/: Compatibility layer and patches for
bridging http@0 and http@1 types in server SDK.
Updated Examples
Modified existing examples to use [email protected]/[email protected]:
Key Updates
Testing
Examples can be run with both HTTP versions to verify compatibility.
Relates to #3362