public class PollingConfig extends Object implements RetrievalSpecificConfig
| Modifier and Type | Field and Description |
|---|---|
static int |
DEFAULT_MAX_RECORDS |
static long |
DEFAULT_MILLIS_BEHIND_LATEST_THRESHOLD_FOR_REDUCED_TPS
Default value for millisBehindLatestThresholdForReducedTps.
|
static Duration |
DEFAULT_REQUEST_TIMEOUT |
static long |
MIN_IDLE_MILLIS_BETWEEN_READS |
| Constructor and Description |
|---|
PollingConfig(software.amazon.awssdk.services.kinesis.KinesisAsyncClient kinesisClient) |
PollingConfig(String streamName,
software.amazon.awssdk.services.kinesis.KinesisAsyncClient kinesisClient) |
| Modifier and Type | Method and Description |
|---|---|
PollingConfig |
idleTimeBetweenReadsInMillis(long idleTimeBetweenReadsInMillis)
Set the value for how long the ShardConsumer should sleep in between calls to
KinesisAsyncClient.getRecords(GetRecordsRequest). |
PollingConfig |
maxRecords(int maxRecords) |
RetrievalFactory |
retrievalFactory()
Creates and returns a retrieval factory for the specific configuration
|
void |
setIdleTimeBetweenReadsInMillis(long idleTimeBetweenReadsInMillis)
Deprecated.
|
void |
validateState(boolean isMultiStream)
Validates this instance is configured properly.
|
public static final Duration DEFAULT_REQUEST_TIMEOUT
public static final int DEFAULT_MAX_RECORDS
public static final long MIN_IDLE_MILLIS_BETWEEN_READS
public static long DEFAULT_MILLIS_BEHIND_LATEST_THRESHOLD_FOR_REDUCED_TPS
public PollingConfig(software.amazon.awssdk.services.kinesis.KinesisAsyncClient kinesisClient)
kinesisClient - Client used to access Kinesis services.public PollingConfig(String streamName, software.amazon.awssdk.services.kinesis.KinesisAsyncClient kinesisClient)
streamName - Name of Kinesis stream.kinesisClient - Client used to access Kinesis serivces.@Deprecated public void setIdleTimeBetweenReadsInMillis(long idleTimeBetweenReadsInMillis)
public PollingConfig idleTimeBetweenReadsInMillis(long idleTimeBetweenReadsInMillis)
KinesisAsyncClient.getRecords(GetRecordsRequest). If this is not specified here the value provided in
RecordsFetcherFactory will be used. Cannot set value below MIN_IDLE_MILLIS_BETWEEN_READS.public PollingConfig maxRecords(int maxRecords)
public RetrievalFactory retrievalFactory()
RetrievalSpecificConfigretrievalFactory in interface RetrievalSpecificConfigpublic void validateState(boolean isMultiStream)
RetrievalSpecificConfigIllegalArgumentException -- should be thrown so
the caller may rectify the misconfiguration.validateState in interface RetrievalSpecificConfigisMultiStream - whether state should be validated for multi-streamCopyright © 2025. All rights reserved.