function createStream(callback) {
     var params = {
       'ShardCount': 1, 
       'StreamName': 'my-stream'
     };
     kinesis.createStream(params, function(err, data) {
         if (err) console.log(err, err.stack);
         else console.log(data);
         callback(err);
     });
     
 }
Example #2
0
    kinesaliteServer.listen(4567, function (err) {
      if (err) throw err;
      log.info('Kinesalite started on port 4567')

      // Create an AWS Kinesis connection
      kinesis = new AWS.Kinesis({region: REGION, /*credentials: { accessKeyId: AWS.config.accessKeyId, secretAccessKey: AWS.config.secretAccessKey },*/ endpoint: 'http://localhost:4567'})
      log.info('Kinesis client created');

      var params = {
        ShardCount: 1,
        StreamName: STREAM_NAME
      };

      kinesis.createStream(params, function(err, data) {
        if (err) {
          console.log(err, err.stack);
          log.error(err);
        }
        else {
          log.info('Stream created: ' + STREAM_NAME);
        }
        done();
      });
    })
Example #3
0
test('createStream', function(t) {
  kinesis.createStream({ShardCount:4, StreamName: 'teststream'}, function(err){
    t.error(err);
    t.end();
  });
});