Skip to content
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

No mechanism for middleware to identify which service/operation a request is for #1919

Closed
jonhoo opened this issue Oct 28, 2022 · 1 comment
Assignees

Comments

@jonhoo
Copy link
Contributor

jonhoo commented Oct 28, 2022

I'm currently writing a Smithy middleware that allows applying per-operation timeouts. That is, when constructed, the user can supply something like:

{
  "SomeService/this_op": 1000,
  "SomeService/other_op": 86400,
  "SomeService/*": 5000,
  "SomeOtherService/that_op": 50
}

and the middleware ensures that the right timeout is applied for each request.

Unfortunately, at the moment, doing so isn't possible (as far as I can tell) because middleware only receive a aws_smithy_http::operation::Request consisting of a http::Request<SdkBody> and a SharedPropertyBag, neither of which include the service/operation metadata, which is discarded here:
https://github.com/awslabs/smithy-rs/blob/c5c87be5e684704bf8fdb31e62e5e5c1b37531a8/rust-runtime/aws-smithy-http-tower/src/parse_response.rs#L103-L107

So, my plea: can Metadata be included in the SharedPropertyBag of a Request? Or, alternatively, can the service and operation name be otherwise added to the property bag or Request through some other mechanism so that this use-case becomes possible?

@Velfi
Copy link
Contributor

Velfi commented Jul 7, 2023

This was added a while back but we never closed the ticket until now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants