Skip to content

chore: Update projects readme for nuget #495

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

Merged
merged 2 commits into from
Sep 28, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
57 changes: 51 additions & 6 deletions libraries/src/AWS.Lambda.Powertools.BatchProcessing/README.md
Original file line number Diff line number Diff line change
@@ -1,14 +1,59 @@
# AWS.Lambda.Powertools.BatchProcessing
...

The batch processing utility handles partial failures when processing batches from Amazon SQS, Amazon Kinesis Data Streams, and Amazon DynamoDB Streams.

## Key features
...

* Reports batch item failures to reduce number of retries for a record upon errors
* Simple interface to process each batch record
* Bring your own batch processor
* Parallel processing

## Background

When using SQS, Kinesis Data Streams, or DynamoDB Streams as a Lambda event source, your Lambda functions are triggered with a batch of messages.

If your function fails to process any message from the batch, the entire batch returns to your queue or stream. This same batch is then retried until either condition happens first: a) your Lambda function returns a successful response, b) record reaches maximum retry attempts, or c) when records expire.

This behavior changes when you enable Report Batch Item Failures feature in your Lambda function event source configuration:

* [SQS queues](https://docs.powertools.aws.dev/lambda/dotnet/utilities/batch-processing/#sqs-standard). Only messages reported as failure will return to the queue for a retry, while successful ones will be deleted.
* [Kinesis data streams](https://docs.powertools.aws.dev/lambda/dotnet/utilities/batch-processing/#kinesis-and-dynamodb-streams) and [DynamoDB streams](https://docs.powertools.aws.dev/lambda/dotnet/utilities/batch-processing/#kinesis-and-dynamodb-streams). Single reported failure will use its sequence number as the stream checkpoint. Multiple reported failures will use the lowest sequence number as checkpoint.

## Read the docs
...

For a full list of features go to [docs.powertools.aws.dev/lambda/dotnet/utilities/batch-processing/](https://docs.powertools.aws.dev/lambda/dotnet/utilities/batch-processing/)

GitHub: https://github.com/aws-powertools/powertools-lambda-dotnet/

## Sample Function
...

## Sample output
...
View the full example here: [github.com/aws-powertools/powertools-lambda-dotnet/tree/develop/examples/BatchProcessing](https://github.com/aws-powertools/powertools-lambda-dotnet/tree/develop/examples/BatchProcessing)

```csharp
[BatchProcessor(RecordHandler = typeof(CustomSqsRecordHandler))]
public BatchItemFailuresResponse HandlerUsingAttribute(SQSEvent _)
{
return SqsBatchProcessor.Result.BatchItemFailuresResponse;
}

public class CustomSqsRecordHandler : ISqsRecordHandler
{
public async Task<RecordHandlerResult> HandleAsync(SQSEvent.SQSMessage record, CancellationToken cancellationToken)
{
/*
Your business logic.
If an exception is thrown, the item will be marked as a partial batch item failure.
*/

var product = JsonSerializer.Deserialize<JsonElement>(record.Body);

if (product.GetProperty("Id").GetInt16() == 4)
{
throw new ArgumentException("Error on 4");
}

return await Task.FromResult(RecordHandlerResult.None);
}
}
```
2 changes: 2 additions & 0 deletions libraries/src/AWS.Lambda.Powertools.Common/README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# AWS.Lambda.Powertools.Common

Powertools for AWS Lambda (.NET) Common library

### As of release 1.7.0 of Powertools for AWS Lambda (.NET) this package is no longer required. For that reason It’s being deprecated and is no longer maintained.
27 changes: 24 additions & 3 deletions libraries/src/AWS.Lambda.Powertools.Idempotency/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,15 @@ times with the same parameters**. This makes idempotent operations safe to retry

* Prevent Lambda handler function from executing more than once on the same event payload during a time window
* Ensure Lambda handler returns the same result when called with the same payload
* Select a subset of the event as the idempotency key using JMESPath expressions
* Select a subset of the event as the idempotency key using [JMESPath](https://jmespath.org/) expressions
* Set a time window in which records with the same payload should be considered duplicates
* Expires in-progress executions if the Lambda function times out halfway through

## Read the docs

For a full list of features go to [docs.powertools.aws.dev/lambda/dotnet/utilities/idempotency/](https://docs.powertools.aws.dev/lambda/dotnet/utilities/idempotency/)

GitHub: https://github.com/aws-powertools/powertools-lambda-dotnet/

## Installation
You should install with NuGet:
Expand All @@ -35,5 +41,20 @@ Or via the .NET Core command line interface:
dotnet add package Amazon.Lambda.PowerTools.Idempotency
```

## Acknowledgment
This project has been ported from the Java Idempotency PowerTool Utility
## Sample Function

```csharp
public class Function
{
public Function()
{
Idempotency.Configure(builder => builder.UseDynamoDb("idempotency_table"));
}

[Idempotent]
public Task<string> FunctionHandler(string input, ILambdaContext context)
{
return Task.FromResult(input.ToUpper());
}
}
```
2 changes: 1 addition & 1 deletion libraries/src/AWS.Lambda.Powertools.Logging/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ The logging utility provides a [AWS Lambda](https://aws.amazon.com/lambda/) opti

## Read the docs

For a full list of features go to [docs.powertools.aws.dev/lambda/dotnet/core/logging/](docs.powertools.aws.dev/lambda/dotnet/core/logging/)
For a full list of features go to [docs.powertools.aws.dev/lambda/dotnet/core/logging/](https://docs.powertools.aws.dev/lambda/dotnet/core/logging/)

GitHub: https://github.com/aws-powertools/powertools-lambda-dotnet/

Expand Down
2 changes: 1 addition & 1 deletion libraries/src/AWS.Lambda.Powertools.Metrics/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ These metrics can be visualized through [Amazon CloudWatch Console](https://aws.

## Read the docs

For a full list of features go to [docs.powertools.aws.dev/lambda/dotnet/core/metrics/](docs.powertools.aws.dev/lambda/dotnet/core/metrics/)
For a full list of features go to [docs.powertools.aws.dev/lambda/dotnet/core/metrics/](https://docs.powertools.aws.dev/lambda/dotnet/core/metrics/)

GitHub: https://github.com/aws-powertools/powertools-lambda-dotnet/

Expand Down
2 changes: 1 addition & 1 deletion libraries/src/AWS.Lambda.Powertools.Parameters/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ The Parameters utility provides high-level functionality to retrieve one or mult

## Read the docs

For a full list of features go to [docs.powertools.aws.dev/lambda/dotnet/utilities/parameters/](docs.powertools.aws.dev/lambda/dotnet/utilities/parameters/)
For a full list of features go to [docs.powertools.aws.dev/lambda/dotnet/utilities/parameters/](https://docs.powertools.aws.dev/lambda/dotnet/utilities/parameters/)

GitHub: <https://github.com/aws-powertools/powertools-lambda-dotnet/>

Expand Down
2 changes: 1 addition & 1 deletion libraries/src/AWS.Lambda.Powertools.Tracing/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ a provides functionality to reduce the overhead of performing common tracing tas

## Read the docs

For a full list of features go to [docs.powertools.aws.dev/lambda/dotnet/core/tracing/](docs.powertools.aws.dev/lambda/dotnet/core/tracing/)
For a full list of features go to [docs.powertools.aws.dev/lambda/dotnet/core/tracing/](https://docs.powertools.aws.dev/lambda/dotnet/core/tracing/)

**GitHub:** https://github.com/aws-powertools/powertools-lambda-dotnet/

Expand Down