lib/utils.js
function createKafkaConsumerAsync(kafkaConfig) {
    let topicConfig = {};
    if ('default_topic_config' in kafkaConfig) {
        topicConfig = kafkaConfig.default_topic_config;
        delete kafkaConfig.default_topic_config;
    }

    const consumer = P.promisifyAll(
        new kafka.KafkaConsumer(kafkaConfig, topicConfig)
    );

    return consumer.connectAsync(undefined)
    .thenReturn(consumer);
}
function createKafkaConsumerAsync(kafkaConfig) {
    let topicConfig = {};
    if ('default_topic_config' in kafkaConfig) {
        topicConfig = kafkaConfig.default_topic_config;
        delete kafkaConfig.default_topic_config;
    }

    const consumer = P.promisifyAll(
        new kafka.KafkaConsumer(kafkaConfig, topicConfig)
    );

    return consumer.connectAsync(undefined)
    .thenReturn(consumer);
}
function createKafkaConsumerAsync ( kafkaConfig ) { let topicConfig = { } ; if ( 'default_topic_config' in kafkaConfig ) { topicConfig = kafkaConfig . default_topic_config ; delete kafkaConfig . default_topic_config ; } const consumer = P . promisifyAll ( new kafka . KafkaConsumer ( kafkaConfig , topicConfig ) ) ; return consumer . connectAsync ( undefined ) . thenReturn ( consumer ) ; }
Returns a Promise of a promisified and connected rdkafka.KafkaConsumer.

@param  {Object} kafkaConfig
@return {Promise<KafkaConsumer>} Promisified KafkaConsumer
Returns a Promise of a promisified and connected rdkafka . KafkaConsumer .