producer¶
AWS Kinesis Data Streams producer implementation.
- class unistream_aws_kinesis.producer.AwsKinesisStreamProducer(buffer: AbcBuffer = REQ, retry_config: RetryConfig = REQ, kinesis_client: KinesisClient = REQ, stream_name: str = REQ)[source]¶
Producer that sends records to an AWS Kinesis Data Stream.
Uses
kinesis_client.put_records()to send batches of records.- Parameters:
kinesis_client – A boto3 Kinesis client.
stream_name – The name of the Kinesis stream.
Note
The
PutRecordsAPI accepts at most 500 records per request and 5 MB per request, with a per-shard write limit of 1,000 records/sec and 1 MB/sec (see Kinesis Quotas). When constructing thebuffer, make suremax_records <= 500andmax_bytesdoes not exceed 5 MB (5_000_000) to stay within a singlePutRecordscall limit.- classmethod new(buffer: T_BUFFER, retry_config: RetryConfig, kinesis_client: KinesisClient, stream_name: str)[source]¶
Create an
AwsKinesisStreamProducerinstance.- Parameters:
buffer – Buffer for batching records.
retry_config – Retry configuration for send failures.
kinesis_client – A boto3 Kinesis client.
stream_name – The name of the Kinesis stream.