Example #1
0
.then((returnVal) => {
    if(returnVal) {
        console.log('EVERYTHING OK');   
    } else {
        console.log('FAILED, NO ERROR THROWN');
    }
    
    groupConsumer.end();
})
Example #2
0
        captureTimestamp: packedImage.capture_timestamp
      });
    });
  }
}

function getConsumerLag(captureTimestamp) {
  const captureDate = new Date(0);
  captureDate.setUTCSeconds(captureTimestamp);
  return (new Date() - captureDate) / 1000;
}

const consumer = new kafka.GroupConsumer({
  connectionString: kafka_hosts,
  groupId: 'IMAGE_PUSHER',
  logger: {
    logFunction: info
  }
});

const producer = new kafka.Producer({
  connectionString: kafka_hosts
});

consumer.init([{
  strategy: 'DEFAULT_STRATEGY',
  subscriptions: ['PROCESSED_FEED'],
  handler: handleKafkaMessages
}]);

producer.init();
Example #3
0
.catch(() => {
    console.log('THIS DOES NOT PRINT');
    groupConsumer.end();
});
Example #4
0
bluebird.try(() => {
    console.log('STARTING');
    groupConsumer.init(strategies);
})