Skip to content

AWS Context is coming as null [message.getHeaders().get("aws-context", Context.class)] #997

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

Closed
nbenjamin opened this issue Jan 28, 2023 · 4 comments

Comments

@nbenjamin
Copy link

nbenjamin commented Jan 28, 2023

Describe the bug
Version
Spring-cloud-function-adapter-aws - 3.2.4

AWS Context is coming as null from header. As mentioned in the document application was expecting context from Message header.

ex:

public class ServicenameFunction implements
    Function<Message<ApplicationLoadBalancerRequestEvent>, ApplicationLoadBalancerResponseEvent> {

  public ApplicationLoadBalancerResponseEvent apply(
      Message<ApplicationLoadBalancerRequestEvent> message) {
    var context = message.getHeaders().get("aws-context", Context.class);

  // context is coming as null
  }
}
@nbenjamin
Copy link
Author

@olegz - Could you please check this above issue?

@olegz olegz added the AWS label Feb 24, 2023
@olegz olegz self-assigned this Feb 24, 2023
@olegz olegz added the bug label Feb 24, 2023
@olegz olegz added this to the 4.0.2 milestone Feb 24, 2023
@olegz
Copy link
Contributor

olegz commented Mar 1, 2023

Yes indeed it's not coming. Will fix

@olegz
Copy link
Contributor

olegz commented Mar 1, 2023

Actually i'll take it back. I am about to commit the test that validates that in fact it is coming thru.
I noticed you are using 3.2.4. We are at 3.2.9, perhaps there was a bug but it was fixed, so consider upgrading and if issue persists let us know by rasing a new issue against the latest version.

@olegz olegz added task and removed bug labels Mar 1, 2023
@olegz
Copy link
Contributor

olegz commented Mar 1, 2023

Changing it to task to add a test vaidating that this is not an issue with the latest version

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

No branches or pull requests

2 participants