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

Adding new event for SQS API requests #710

Closed
rgreinho opened this issue Oct 23, 2023 · 3 comments · Fixed by #711
Closed

Adding new event for SQS API requests #710

rgreinho opened this issue Oct 23, 2023 · 3 comments · Fixed by #711

Comments

@rgreinho
Copy link
Contributor

rgreinho commented Oct 23, 2023

I am trying to use a new Rust Lambda in one of my step functions.

The flow is very simple, with 3 steps (the Rust Lambda is the second step):

ReceiveSQSMessage ->  ProcessMessagePayload -> DeleteSQS Message

However it looks like I cannot deserialize the message with

async fn function_handler(event: LambdaEvent<SqsMessageObj<AnalysisParameters>>) -> Result<(), Error>

because there is no records field.

SqsMessageObj seems to be matching the structure described here: https://docs.aws.amazon.com/lambda/latest/dg/with-sqs.html#example-standard-queue-message-event, but when using the step function task, the structure is different: https://docs.aws.amazon.com/AWSSimpleQueueService/latest/APIReference/API_ReceiveMessage.html#API_ReceiveMessage_ResponseSyntax.

So if my understanding is correct, we would need to add 2 new structs: SqsAPIEventObj and SqsAPIMessageObj, matching the format described in the second link.

@calavera
Copy link
Contributor

Feel free to send a PR with new structs. We very appreciate those contributions. 🙌

rgreinho added a commit to rgreinho/aws-lambda-rust-runtime that referenced this issue Oct 23, 2023
Adds strucs to allow serializing data coming from the AWS SQS API.

Fixes awslabs#710

Signed-off-by: Rémy Greinhofer <[email protected]>
@rgreinho
Copy link
Contributor Author

Alright! #711 should do the trick.

calavera pushed a commit that referenced this issue Oct 23, 2023
Adds strucs to allow serializing data coming from the AWS SQS API.

Fixes #710

Signed-off-by: Rémy Greinhofer <[email protected]>
@github-actions
Copy link

⚠️COMMENT VISIBILITY WARNING⚠️

Comments on closed issues are hard for the maintainers of this repository to see.
If you need more assistance, please open a new issue that references this one.
If you wish to keep having a conversation with other community members under this issue feel free to do so.

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

Successfully merging a pull request may close this issue.

2 participants