Skip to content

Commit 09fc7f9

Browse files
committed
Sonar fixes.
1 parent e1d88c2 commit 09fc7f9

File tree

2 files changed

+29
-11
lines changed

2 files changed

+29
-11
lines changed

examples/BatchProcessing/template.yaml

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,6 +96,12 @@ Resources:
9696
- ReportBatchItemFailures
9797
Queue: !GetAtt SqsQueue.Arn
9898

99+
SqsBatchProcessorFunctionLogGroup:
100+
Type: AWS::Logs::LogGroup
101+
Properties:
102+
LogGroupName: !Sub "/aws/lambda/${SqsBatchProcessorFunction}"
103+
RetentionInDays: 7
104+
99105
# --------------
100106
# Batch Processing for DynamoDb (DDB) Stream
101107
DdbStreamDeadLetterQueue:
@@ -116,7 +122,7 @@ Resources:
116122
StreamSpecification:
117123
StreamViewType: NEW_AND_OLD_IMAGES
118124

119-
DdbStreamProcessorFunction:
125+
DdbStreamBatchProcessorFunction:
120126
Type: AWS::Serverless::Function
121127
Properties:
122128
CodeUri: ./src/HelloWorld/
@@ -152,6 +158,12 @@ Resources:
152158
StartingPosition: LATEST
153159
Stream: !GetAtt DdbTable.StreamArn
154160

161+
DdbStreamBatchProcessorFunctionLogGroup:
162+
Type: AWS::Logs::LogGroup
163+
Properties:
164+
LogGroupName: !Sub "/aws/lambda/${DdbStreamBatchProcessorFunction}"
165+
RetentionInDays: 7
166+
155167
# --------------
156168
# Batch Processing for Kinesis Data Stream
157169
KinesisStreamDeadLetterQueue:
@@ -215,6 +227,12 @@ Resources:
215227
StartingPosition: LATEST
216228
Stream: !GetAtt KinesisStreamConsumer.ConsumerARN
217229

230+
KinesisBatchProcessorFunctionLogGroup:
231+
Type: AWS::Logs::LogGroup
232+
Properties:
233+
LogGroupName: !Sub "/aws/lambda/${KinesisBatchProcessorFunction}"
234+
RetentionInDays: 7
235+
218236
Outputs:
219237
SqsQueueUrl:
220238
Description: "SQS Queue URL"

libraries/src/AWS.Lambda.Powertools.BatchProcessing/BatchProcessorAttribute.cs

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -133,44 +133,44 @@ public class BatchProcessorAttribute : UniversalWrapperAttribute
133133
/// <summary>
134134
/// Type of batch processor.
135135
/// </summary>
136-
public Type BatchProcessor;
136+
public Type BatchProcessor { get; set; }
137137

138138
/// <summary>
139139
/// Type of batch processor provider.
140140
/// </summary>
141-
public Type BatchProcessorProvider;
141+
public Type BatchProcessorProvider { get; set; }
142142

143143
/// <summary>
144144
/// Type of record handler.
145145
/// </summary>
146-
public Type RecordHandler;
146+
public Type RecordHandler { get; set; }
147147

148148
/// <summary>
149149
/// Type of record handler provider.
150150
/// </summary>
151-
public Type RecordHandlerProvider;
151+
public Type RecordHandlerProvider { get; set; }
152152

153153
/// <summary>
154154
/// Error handling policy.
155155
/// </summary>
156-
public BatchProcessorErrorHandlingPolicy ErrorHandlingPolicy;
156+
public BatchProcessorErrorHandlingPolicy ErrorHandlingPolicy { get; set; }
157157

158158
/// <summary>
159159
/// Batch processing enabled (default false)
160160
/// </summary>
161-
public bool BatchParallelProcessingEnabled = PowertoolsConfigurations.Instance.BatchParallelProcessingEnabled;
161+
public bool BatchParallelProcessingEnabled { get; set; } = PowertoolsConfigurations.Instance.BatchParallelProcessingEnabled;
162162

163163
/// <summary>
164164
/// The maximum degree of parallelism to apply during batch processing.
165165
/// Must enable BatchParallelProcessingEnabled
166166
/// </summary>
167-
public int MaxDegreeOfParallelism = PowertoolsConfigurations.Instance.BatchProcessingMaxDegreeOfParallelism;
167+
public int MaxDegreeOfParallelism { get; set; } = PowertoolsConfigurations.Instance.BatchProcessingMaxDegreeOfParallelism;
168168

169-
/// <summary>
169+
/// <summary>
170170
/// By default, the Batch processor throws a <see cref="BatchProcessingException"/> on full batch failure.
171-
/// This behaviour can be disabled by setting this value to false.
171+
/// This behaviour can be disabled by setting this value to false.
172172
/// </summary>
173-
public bool ThrowOnFullBatchFailure = PowertoolsConfigurations.Instance.BatchThrowOnFullBatchFailureEnabled;
173+
public bool ThrowOnFullBatchFailure { get; set; } = PowertoolsConfigurations.Instance.BatchThrowOnFullBatchFailureEnabled;
174174

175175
private static readonly Dictionary<Type, BatchEventType> EventTypes = new()
176176
{

0 commit comments

Comments
 (0)