Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
const streamToObservable = require('stream-to-observable');
const Rx = require('rxjs/Rx');
const async = require('async');
const Bluebird = require('bluebird');
const {
KAFKA_HOST,
TOPIC,
PRODUCER_CONFIG,
TOPIC_EVENTS,
PUBSUB_TOPIC,
MONGO_URL,
MONGO_COLLECTION
} = require('./config');
const { getPartition, getBusinessRulesOfEvent } = require('./utils');
const client = new kafka.Client();
const consumerGroup = new kafka.ConsumerGroupStream(
{
kafkaHost: KAFKA_HOST,
groupId: 'ExampleTestGroup',
sessionTimeout: 15000,
protocol: ['roundrobin'],
fromOffset: 'latest',
asyncPush: false,
autoCommit: false
},
TOPIC
);
const producer = new kafka.Producer(client, PRODUCER_CONFIG, getPartition);
var redisClient = require('redis').createClient();
const _ = require('lodash');
var MongoClient = require('mongodb').MongoClient;