Skip to content

Commit d8e60bf

Browse files
authored
Merge pull request #495 from hjgraca/update-projects-readme
chore: Update projects readme for nuget
2 parents bddf55b + c736df9 commit d8e60bf

File tree

7 files changed

+81
-13
lines changed

7 files changed

+81
-13
lines changed
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,59 @@
11
# AWS.Lambda.Powertools.BatchProcessing
2-
...
2+
3+
The batch processing utility handles partial failures when processing batches from Amazon SQS, Amazon Kinesis Data Streams, and Amazon DynamoDB Streams.
34

45
## Key features
5-
...
6+
7+
* Reports batch item failures to reduce number of retries for a record upon errors
8+
* Simple interface to process each batch record
9+
* Bring your own batch processor
10+
* Parallel processing
11+
12+
## Background
13+
14+
When using SQS, Kinesis Data Streams, or DynamoDB Streams as a Lambda event source, your Lambda functions are triggered with a batch of messages.
15+
16+
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.
17+
18+
This behavior changes when you enable Report Batch Item Failures feature in your Lambda function event source configuration:
19+
20+
* [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.
21+
* [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.
622

723
## Read the docs
8-
...
24+
25+
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/)
26+
27+
GitHub: https://github.com/aws-powertools/powertools-lambda-dotnet/
928

1029
## Sample Function
11-
...
1230

13-
## Sample output
14-
...
31+
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)
32+
33+
```csharp
34+
[BatchProcessor(RecordHandler = typeof(CustomSqsRecordHandler))]
35+
public BatchItemFailuresResponse HandlerUsingAttribute(SQSEvent _)
36+
{
37+
return SqsBatchProcessor.Result.BatchItemFailuresResponse;
38+
}
39+
40+
public class CustomSqsRecordHandler : ISqsRecordHandler
41+
{
42+
public async Task<RecordHandlerResult> HandleAsync(SQSEvent.SQSMessage record, CancellationToken cancellationToken)
43+
{
44+
/*
45+
Your business logic.
46+
If an exception is thrown, the item will be marked as a partial batch item failure.
47+
*/
48+
49+
var product = JsonSerializer.Deserialize<JsonElement>(record.Body);
50+
51+
if (product.GetProperty("Id").GetInt16() == 4)
52+
{
53+
throw new ArgumentException("Error on 4");
54+
}
55+
56+
return await Task.FromResult(RecordHandlerResult.None);
57+
}
58+
}
59+
```

Diff for: libraries/src/AWS.Lambda.Powertools.Common/README.md

+2
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
11
# AWS.Lambda.Powertools.Common
22

33
Powertools for AWS Lambda (.NET) Common library
4+
5+
### 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.

Diff for: libraries/src/AWS.Lambda.Powertools.Idempotency/README.md

+24-3
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,15 @@ times with the same parameters**. This makes idempotent operations safe to retry
1818

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

25+
## Read the docs
26+
27+
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/)
28+
29+
GitHub: https://github.com/aws-powertools/powertools-lambda-dotnet/
2430

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

38-
## Acknowledgment
39-
This project has been ported from the Java Idempotency PowerTool Utility
44+
## Sample Function
45+
46+
```csharp
47+
public class Function
48+
{
49+
public Function()
50+
{
51+
Idempotency.Configure(builder => builder.UseDynamoDb("idempotency_table"));
52+
}
53+
54+
[Idempotent]
55+
public Task<string> FunctionHandler(string input, ILambdaContext context)
56+
{
57+
return Task.FromResult(input.ToUpper());
58+
}
59+
}
60+
```

Diff for: libraries/src/AWS.Lambda.Powertools.Logging/README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ The logging utility provides a [AWS Lambda](https://aws.amazon.com/lambda/) opti
1111

1212
## Read the docs
1313

14-
For a full list of features go to [docs.powertools.aws.dev/lambda/dotnet/core/logging/](docs.powertools.aws.dev/lambda/dotnet/core/logging/)
14+
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/)
1515

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

Diff for: libraries/src/AWS.Lambda.Powertools.Metrics/README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ These metrics can be visualized through [Amazon CloudWatch Console](https://aws.
1313

1414
## Read the docs
1515

16-
For a full list of features go to [docs.powertools.aws.dev/lambda/dotnet/core/metrics/](docs.powertools.aws.dev/lambda/dotnet/core/metrics/)
16+
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/)
1717

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

Diff for: libraries/src/AWS.Lambda.Powertools.Parameters/README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ The Parameters utility provides high-level functionality to retrieve one or mult
1111

1212
## Read the docs
1313

14-
For a full list of features go to [docs.powertools.aws.dev/lambda/dotnet/utilities/parameters/](docs.powertools.aws.dev/lambda/dotnet/utilities/parameters/)
14+
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/)
1515

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

Diff for: libraries/src/AWS.Lambda.Powertools.Tracing/README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ a provides functionality to reduce the overhead of performing common tracing tas
1313

1414
## Read the docs
1515

16-
For a full list of features go to [docs.powertools.aws.dev/lambda/dotnet/core/tracing/](docs.powertools.aws.dev/lambda/dotnet/core/tracing/)
16+
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/)
1717

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

0 commit comments

Comments
 (0)