public String getStreamName() { if (kinesisConfig == null) { return null; } return kinesisConfig.getStreamName(); }
public String getStreamName() { return kinesisConfig.getStreamName(); }
private static DynamoDBStreamsProxy getDynamoDBStreamsProxy(KinesisClientLibConfiguration config, AmazonDynamoDBStreamsAdapterClient streamsClient) { return new DynamoDBStreamsProxy.Builder( config.getStreamName(), config.getKinesisCredentialsProvider(), streamsClient) .build(); }
/** * Public constructor. * @param config */ public KinesisProxy(final KinesisClientLibConfiguration config, final AmazonKinesis client) { this(config.getStreamName(), client, DEFAULT_DESCRIBE_STREAM_BACKOFF_MILLIS, DEFAULT_DESCRIBE_STREAM_RETRY_TIMES, config.getListShardsBackoffTimeInMillis(), config.getMaxListShardsRetryAttempts()); this.credentialsProvider = config.getKinesisCredentialsProvider(); }
private static DynamoDBStreamsProxy getDynamoDBStreamsProxy(KinesisClientLibConfiguration config, AmazonDynamoDBStreamsAdapterClient streamsClient) { return new DynamoDBStreamsProxy.Builder( config.getStreamName(), config.getKinesisCredentialsProvider(), streamsClient) .build(); }
@Override public void processRecords(ProcessRecordsInput processRecordsInput) { logger.info("processRecords"); processRecordsInput.getRecords().forEach(record -> { KinesisRecord kr = new KinesisRecord(); kr.record = record; Event<KinesisRecord> event = Event.wrap(kr); getEventBus().notify(kr, event); boolean cp = checkpointStrategy.call(record); if (cp) { try { if (logger.isDebugEnabled()) { logger.debug("checkpointing app {} for stream {} at {}", kinesisConfig.getApplicationName(), kinesisConfig.getStreamName(), record.getSequenceNumber()); } processRecordsInput.getCheckpointer().checkpoint(record); } catch (RuntimeException | InvalidStateException | ShutdownException e) { logger.error("problem with checkpoint", e); } } }); }
logger.info("streamName: {}", kinesisConfig.getStreamName()); logger.info("regionName: {}", kinesisConfig.getRegionName()); logger.info("workerId : {}", kinesisConfig.getWorkerIdentifier());
/** * @param propertiesFile The location of the properties file. * @param classLoader A classloader, useful if trying to programmatically configure with the daemon, such as in a * unit test. * @param configurator A configurator to use. * @throws IOException Thrown when the properties file can't be accessed. * @throws IllegalArgumentException Thrown when the contents of the properties file are not as expected. */ public MultiLangDaemonConfig(String propertiesFile, ClassLoader classLoader, KinesisClientLibConfigurator configurator) throws IOException, IllegalArgumentException { Properties properties = loadProperties(classLoader, propertiesFile); if (!validateProperties(properties)) { throw new IllegalArgumentException( "Must provide an executable name in the properties file, " + "e.g. executableName = sampleapp.py"); } String executableName = properties.getProperty(PROP_EXECUTABLE_NAME); String processingLanguage = properties.getProperty(PROP_PROCESSING_LANGUAGE); ClientConfiguration clientConfig = buildClientConfig(properties); kinesisClientLibConfig = configurator.getConfiguration(properties).withKinesisClientConfig(clientConfig) .withCloudWatchClientConfig(clientConfig).withDynamoDBClientConfig(clientConfig); executorService = buildExecutorService(properties); recordProcessorFactory = new MultiLangRecordProcessorFactory(executableName, executorService, kinesisClientLibConfig); LOG.info("Running " + kinesisClientLibConfig.getApplicationName() + " to process stream " + kinesisClientLibConfig.getStreamName() + " with executable " + executableName); prepare(processingLanguage); }
.format("Amazon Kinesis Aggregators Managed Client prepared for %s on %s in %s (%s) using %s Max Records", config.getApplicationName(), config.getStreamName(), config.getRegionName(), config.getWorkerIdentifier(), config.getMaxRecords()));
kinesisClient, this.config.getStreamName()))) { this.isFirstShardWorker = true; logInfo("Aggregator taking Primary Thread Responsibility");