lifion / lifion-kinesis

A native Node.js producer and consumer library for Amazon Kinesis Data Streams
MIT License
86 stars 18 forks source link

Add documentation for DynamoDB setup #226

Open chrkaatz opened 5 years ago

chrkaatz commented 5 years ago

Hey,

I was about to try your library which looks very promising. Could you add some kind of information on how to setup the DynamoDB and what would be the primaryKey for it?

I cannot initialize the kinesis consumer

const Kinesis = require('lifion-kinesis');
const streamName = 'testStream';
const logger = require('tracer).console({level:'debug'});

const kinesisConsumer = new Kinesis({
  apiVersion: '2013-12-02',
  region: 'eu-central-1',
  streamName,
  createStreamIfNeeded: false,
  useAutoCheckpoints: true,
  maxRetries: 5,
  dynamoDb: {
    apiVersion: '2012-08-10',
    region: 'eu-central-1',
    tableName: 'lifion-kinesis-state',
  },
  useEnhancedFanOut: false,
  logger,
});
kinesisConsumer.on('data', data => {
  console.log('Incoming data:', data);
});
kinesisConsumer.on('error', err => {
  logger.error(err);
});
kinesisConsumer.on('stats', stats => {
  logger.info(stats);
});
kinesisConsumer
  .startConsumer()
  .then(() => {
    logger.info('consumer started');
  })
  .catch(err => logger.error);

2019-09-05T13:21:51+0200 stream.js:143 (ensureStreamExists) Verifying the "testStream" stream exists and it's active… 2019-09-05T13:21:51+0200 stream.js:161 (ensureStreamExists) The stream exists and it's active. 2019-09-05T13:21:51+0200 index.js:300 (Kinesis.startConsumer) Trying to start the consumer… 2019-09-05T13:21:51+0200 table.js:93 (ensureTableExists) Verifying the "lifion-kinesis-state" table exists and it's active… 2019-09-05T13:21:52+0200 table.js:130 (ensureTableExists) The table exists and it's active.

Unfortunately in never arrives at: logger.debug('The consumer is now ready.');

Can you help me?

shaneblaserj2 commented 5 years ago

I have the same question

eaviles commented 4 years ago

@chrkaatz, @shaneblaserj2, I'm working on documenting this now. Should be available shortly.

chrkaatz commented 4 years ago

@eaviles that would be amazing!

eaviles commented 4 years ago

Thanks for your patience @chrkaatz, @shaneblaserj2, still working on this. Should have it up next week.

paulyk1983 commented 3 years ago

Any updates on this?