Java Code Examples for com.amazonaws.services.kinesis.producer.KinesisProducerConfiguration#setMaxConnections()
The following examples show how to use
com.amazonaws.services.kinesis.producer.KinesisProducerConfiguration#setMaxConnections() .
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: AmazonKinesisSinkTask.java From kinesis-kafka-connector with Apache License 2.0 | 5 votes |
private KinesisProducer getKinesisProducer() { KinesisProducerConfiguration config = new KinesisProducerConfiguration(); config.setRegion(regionName); config.setCredentialsProvider(new DefaultAWSCredentialsProviderChain()); config.setMaxConnections(maxConnections); config.setAggregationEnabled(aggregration); // Limits the maximum allowed put rate for a shard, as a percentage of // the // backend limits. config.setRateLimit(rateLimit); // Maximum amount of time (milliseconds) a record may spend being // buffered // before it gets sent. Records may be sent sooner than this depending // on the // other buffering limits config.setRecordMaxBufferedTime(maxBufferedTime); // Set a time-to-live on records (milliseconds). Records that do not get // successfully put within the limit are failed. config.setRecordTtl(ttl); // Controls the number of metrics that are uploaded to CloudWatch. // Expected pattern: none|summary|detailed config.setMetricsLevel(metricsLevel); // Controls the granularity of metrics that are uploaded to CloudWatch. // Greater granularity produces more metrics. // Expected pattern: global|stream|shard config.setMetricsGranularity(metricsGranuality); // The namespace to upload metrics under. config.setMetricsNamespace(metricsNameSpace); return new KinesisProducer(config); }
Example 2
Source File: SampleProducer.java From real-time-analytics-spark-streaming with Apache License 2.0 | 5 votes |
/** * Here'll walk through some of the config options and create an instance of * KinesisProducer, which will be used to put records. * * @param region The region of the Kinesis stream being used. * * @return KinesisProducer instance used to put records. */ private static KinesisProducer getKinesisProducer(final String region) { KinesisProducerConfiguration config = new KinesisProducerConfiguration(); config.setRegion(region); config.setCredentialsProvider(new DefaultAWSCredentialsProviderChain()); config.setMaxConnections(1); config.setRequestTimeout(60000); config.setRecordMaxBufferedTime(2000); config.setAggregationEnabled(false); KinesisProducer producer = new KinesisProducer(config); return producer; }
Example 3
Source File: SampleKPLProducer.java From kinesis-aggregation with Apache License 2.0 | 5 votes |
/** * Given an AWS region, generate a configured Kinesis Producer. */ private static KinesisProducer getKinesisProducer(String region) { KinesisProducerConfiguration config = new KinesisProducerConfiguration(); config.setRegion(region); config.setMaxConnections(1); config.setRequestTimeout(60000); config.setRecordMaxBufferedTime(15000); config.setAggregationEnabled(true); return new KinesisProducer(config); }