> **Experimental**
>
> `@aws-cdk/aws-pipes-sources-alpha` is an [**experimental**](https://docs.aws.amazon.com/cdk/api/stability.html) (alpha) package: its API may change in any release, without a major version bump.
# StreamSourceParameters

Base parameters for streaming sources.

Used as props by: [StreamSource](https://docs.aws.amazon.com/cdk/api/v2/docs/@aws-cdk_aws-pipes-sources-alpha.StreamSource.html)

- Stability: [Experimental](https://docs.aws.amazon.com/cdk/api/stability.html)
- Source: [`lib/streamSource.ts`](https://github.com/aws/aws-cdk/blob/v2.278.0/packages/@aws-cdk/aws-pipes-sources-alpha/lib/streamSource.ts#L11)

## Example

TypeScript:

```ts
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import * as pipes_sources_alpha from '@aws-cdk/aws-pipes-sources-alpha';
import * as cdk from 'aws-cdk-lib';
import { aws_sqs as sqs } from 'aws-cdk-lib';

declare const queue: sqs.Queue;
const streamSourceParameters: pipes_sources_alpha.StreamSourceParameters = {
  batchSize: 123,
  deadLetterTarget: queue,
  maximumBatchingWindow: cdk.Duration.minutes(30),
  maximumRecordAge: cdk.Duration.minutes(30),
  maximumRetryAttempts: 123,
  onPartialBatchItemFailure: pipes_sources_alpha.OnPartialBatchItemFailure.AUTOMATIC_BISECT,
  parallelizationFactor: 123,
};
```

Python:

```python
# The code below shows an example of how to instantiate this type.
# The values are placeholders you should change.
import aws_cdk.aws_pipes_sources_alpha as pipes_sources_alpha
import aws_cdk as cdk
from aws_cdk import aws_sqs as sqs

# queue: sqs.Queue

stream_source_parameters = pipes_sources_alpha.StreamSourceParameters(
    batch_size=123,
    dead_letter_target=queue,
    maximum_batching_window=cdk.Duration.minutes(30),
    maximum_record_age=cdk.Duration.minutes(30),
    maximum_retry_attempts=123,
    on_partial_batch_item_failure=pipes_sources_alpha.OnPartialBatchItemFailure.AUTOMATIC_BISECT,
    parallelization_factor=123
)
```

Java:

```java
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import software.amazon.awscdk.services.pipes.sources.alpha.*;
import software.amazon.awscdk.*;
import software.amazon.awscdk.services.sqs.*;

Queue queue;

StreamSourceParameters streamSourceParameters = StreamSourceParameters.builder()
        .batchSize(123)
        .deadLetterTarget(queue)
        .maximumBatchingWindow(Duration.minutes(30))
        .maximumRecordAge(Duration.minutes(30))
        .maximumRetryAttempts(123)
        .onPartialBatchItemFailure(OnPartialBatchItemFailure.AUTOMATIC_BISECT)
        .parallelizationFactor(123)
        .build();
```

C# / .NET:

```csharp
// Install: dotnet add package Amazon.CDK.AWS.Pipes.Sources.Alpha
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
using Amazon.CDK.AWS.Pipes.Sources.Alpha;
using Amazon.CDK;
using Amazon.CDK.AWS.SQS;

Queue queue;

var streamSourceParameters = new StreamSourceParameters {
    BatchSize = 123,
    DeadLetterTarget = queue,
    MaximumBatchingWindow = Duration.Minutes(30),
    MaximumRecordAge = Duration.Minutes(30),
    MaximumRetryAttempts = 123,
    OnPartialBatchItemFailure = OnPartialBatchItemFailure.AUTOMATIC_BISECT,
    ParallelizationFactor = 123
};
```

Golang:

```go
// Install: go get github.com/aws/aws-cdk-go/awscdkpipessourcesalpha/v2
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import pipes_sources_alpha "github.com/aws/aws-cdk-go/awscdkpipessourcesalpha"
import "github.com/aws/aws-cdk-go/awscdk"
import "github.com/aws/aws-cdk-go/awscdk"

var queue Queue

streamSourceParameters := &StreamSourceParameters{
	BatchSize: jsii.Number(123),
	DeadLetterTarget: queue,
	MaximumBatchingWindow: cdk.Duration_Minutes(jsii.Number(30)),
	MaximumRecordAge: cdk.Duration_*Minutes(jsii.Number(30)),
	MaximumRetryAttempts: jsii.Number(123),
	OnPartialBatchItemFailure: pipes_sources_alpha.OnPartialBatchItemFailure_AUTOMATIC_BISECT,
	ParallelizationFactor: jsii.Number(123),
}
```

## Properties

- `batchSize`: number = 1 — The maximum number of records to include in each batch.

- `deadLetterTarget`: [IQueue](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_sqs.IQueue.html) | [ITopic](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_sns.ITopic.html) — Define the target to send dead-letter queue events to.

  **Default:** no dead-letter queue or topic

  The dead-letter queue stores any events that are not successfully delivered to a Pipes target after all retry attempts are exhausted.
  You can then resolve the issue that caused the failed invocations and replay the events at a later time.
  In some cases, such as when access is denied to a resource, events are sent directly to the dead-letter queue and are not retried.

- `maximumBatchingWindow`: [Duration](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.Duration.html) — The maximum length of a time to wait for events.

  **Default:** the events will be handled immediately

- `maximumRecordAge`: [Duration](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.Duration.html) — Discard records older than the specified age.

  **Default:** -1 - EventBridge won't discard old records

  The default value is -1, which sets the maximum age to infinite. When the value is set to infinite, EventBridge never discards old records.

- `maximumRetryAttempts`: number — Discard records after the specified number of retries.

  **Default:** -1 - EventBridge will retry failed records until the record expires in the event source

  The default value is -1, which sets the maximum number of retries to infinite. When MaximumRetryAttempts is infinite, EventBridge retries failed records until the record expires in the event source.

- `onPartialBatchItemFailure`: [OnPartialBatchItemFailure](https://docs.aws.amazon.com/cdk/api/v2/docs/@aws-cdk_aws-pipes-sources-alpha.OnPartialBatchItemFailure.html) — Define how to handle item process failures.

  **Default:** off - EventBridge will retry the entire batch

  {@link OnPartialBatchItemFailure.AUTOMATIC_BISECT} halves each batch and will retry each half until all the records are processed or there is one failed message left in the batch.

- `parallelizationFactor`: number = 1 — The number of batches to process concurrently from each shard.
