#aws-lambda #aws #sqs #lambda

lambda_sqs

Handles an SQS event and provides a vec of your type for processing

40 releases

0.3.0 Jan 28, 2026
0.2.37 Nov 28, 2025
0.2.36 Oct 28, 2025
0.2.33 Jul 28, 2025
0.2.0 Sep 22, 2021

#231 in Web programming

Download history 84/week @ 2025-10-15 301/week @ 2025-10-22 46/week @ 2025-10-29 127/week @ 2025-11-05 111/week @ 2025-11-12 1456/week @ 2025-11-19 602/week @ 2025-11-26 1013/week @ 2025-12-03 1226/week @ 2025-12-10 867/week @ 2025-12-17 451/week @ 2025-12-24 560/week @ 2025-12-31 1091/week @ 2026-01-07 1052/week @ 2026-01-14 1591/week @ 2026-01-21 1750/week @ 2026-01-28

5,683 downloads per month

MIT/Apache

17KB
58 lines

Rust library lambda_sqs

Crates.io MIT licensed Build Status Rust FOSSA Status Docs BuyMeaCoffee GitHubSponsors

Specialised lambda_runtime to accept and process events from SQS.

SQS Events

SQS dispatches events to a lambda function in batches (often, it seems to my surprise). This crate provides a lambda_runtime implementation that expects to receive a batch of messages in the[SqsEvent] type and provides a method to transform the batch of events to a vec of your Struct.

Usage

To use the crate add the dependency in Cargo.toml.

[dependencies]
lambda_sqs = " 0.3.0"

Example

use your_module::YourStruct;
use lambda_sqs::{handler_fn, Context, Error};
use lambda_sqs::SqsEvent;
#[tokio::main]
async fn main() -> Result<(), Error> {
    lambda_sqs::run(handler_fn(my_handler)).await?;
    Ok(())
}
pub async fn my_handler(e: SqsEvent, c: Context) -> Result<(), Error> {
    let events: Vec<YourStruct> = e.into_t();
#   // Process events
#   Ok(())
 }

License

Licensed under either of

at your option.

Contribution

Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.

Dependencies

~11–26MB
~246K SLoC