Creates a new {@link Consumer}

@param {Broker} broker
@param {consumerConfigFunc} configurator - function to customize consumer configuration (optional)
@returns {Consumer} a consumer
482895
function createConsumer(broker, configurator) {
    var params = getParams(ConsumerConfigurator, configurator);
    return Consumer(broker, params.envelope, params.pipeline, params.routeName, params.routePattern, params.logger, events);
  }
1314452
private KafkaInternalConsumerRunner createConsumerRunner(Properties properties) throws Exception {

        ClassLoader previous = Thread.currentThread().getContextClassLoader();
        Thread.currentThread().setContextClassLoader(getClass().getClassLoader());

        try {
            Consumer<ByteBuffer, ByteBuffer> consumer = new KafkaConsumer<>(properties);
            return new KafkaInternalConsumerRunner(this, m_config, consumer);
        } finally {
            Thread.currentThread().setContextClassLoader(previous);
        }
    }
27328
function SimpleConsumer(options) {
    this.options = _.defaultsDeep(options || {}, {
        groupId: 'no-kafka-group-v0'
    });

    BaseConsumer.call(this, this.options);
}
471071
@Nonnull
	public static <T1, T2> LBiObjSrtConsumerBuilder<T1, T2> biObjSrtConsumer(Consumer<LBiObjSrtConsumer<T1, T2>> consumer) {
		return new LBiObjSrtConsumerBuilder(consumer);
	}
193264
@Nonnull
	public static <T> LOiToIntFunctionBuilder<T> oiToIntFunction(Consumer<LOiToIntFunction<T>> consumer) {
		return new LOiToIntFunctionBuilder(consumer);
	}
955161
@Nonnull
	public static <T, R> LObjDblFunctionBuilder<T, R> objDblFunction(Consumer<LObjDblFunction<T, R>> consumer) {
		return new LObjDblFunctionBuilder(consumer);
	}
58310
@Nonnull
	public static <T, R> LObjBiIntFunctionBuilder<T, R> objBiIntFunction(Consumer<LObjBiIntFunction<T, R>> consumer) {
		return new LObjBiIntFunctionBuilder(consumer);
	}
1273435
private org.apache.kafka.clients.consumer.KafkaConsumer<Object, Object> createConsumer() {
        Map<String, Object> consumerProps = new HashMap<>();
        consumerProps.put(ConsumerConfig.CLIENT_ID_CONFIG, Optional.ofNullable(endpointConfiguration.getClientId()).orElse(KafkaMessageHeaders.KAFKA_PREFIX + "consumer_" + UUID.randomUUID().toString()));
        consumerProps.put(ConsumerConfig.GROUP_ID_CONFIG, endpointConfiguration.getConsumerGroup());
        consumerProps.put(ConsumerConfig.BOOTSTRAP_SERVERS_CONFIG, Optional.ofNullable(endpointConfiguration.getServer()).orElse("localhost:9092"));
        consumerProps.put(ConsumerConfig.MAX_POLL_RECORDS_CONFIG, 1);
        consumerProps.put(ConsumerConfig.ENABLE_AUTO_COMMIT_CONFIG, endpointConfiguration.isAutoCommit());
        consumerProps.put(ConsumerConfig.AUTO_COMMIT_INTERVAL_MS_CONFIG, endpointConfiguration.getAutoCommitInterval());
        consumerProps.put(ConsumerConfig.AUTO_OFFSET_RESET_CONFIG, endpointConfiguration.getOffsetReset());
        consumerProps.put(ConsumerConfig.KEY_DESERIALIZER_CLASS_CONFIG, endpointConfiguration.getKeyDeserializer());
        consumerProps.put(ConsumerConfig.VALUE_DESERIALIZER_CLASS_CONFIG, endpointConfiguration.getValueDeserializer());

        consumerProps.putAll(endpointConfiguration.getConsumerProperties());

        return new org.apache.kafka.clients.consumer.KafkaConsumer<>(consumerProps);
    }
1168754
def _create_consumer(self):
        """"""
        if not self.closed:
            try:
                self.logger.debug("Creating new kafka consumer using brokers: " +
                                   str(self.settings['KAFKA_HOSTS']) + ' and topic ' +
                                   self.settings['KAFKA_TOPIC_PREFIX'] +
                                   ".outbound_firehose")

                return KafkaConsumer(
                    self.settings['KAFKA_TOPIC_PREFIX'] + ".outbound_firehose",
                    group_id=None,
                    bootstrap_servers=self.settings['KAFKA_HOSTS'],
                    consumer_timeout_ms=self.settings['KAFKA_CONSUMER_TIMEOUT'],
                    auto_offset_reset=self.settings['KAFKA_CONSUMER_AUTO_OFFSET_RESET'],
                    auto_commit_interval_ms=self.settings['KAFKA_CONSUMER_COMMIT_INTERVAL_MS'],
                    enable_auto_commit=self.settings['KAFKA_CONSUMER_AUTO_COMMIT_ENABLE'],
                    max_partition_fetch_bytes=self.settings['KAFKA_CONSUMER_FETCH_MESSAGE_MAX_BYTES'])
            except KeyError as e:
                self.logger.error('Missing setting named ' + str(e),
                                   {'ex': traceback.format_exc()})
            except:
                self.logger.error("Couldn't initialize kafka consumer for topic",
                                   {'ex': traceback.format_exc()})
                raise
1342757
@Override
    public ConsumerManager createConsumerManager()
    {
        if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
            SibTr.entry(tc, "createConsumerManager");

        ConsumerDispatcher consumerDispatcher = (ConsumerDispatcher) getOutputHandler();
        if (consumerDispatcher == null)
        {
            consumerDispatcher = new ConsumerDispatcher(destinationHandler, this, new ConsumerDispatcherState());
            setOutputHandler(consumerDispatcher);
        }

        if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
            SibTr.exit(tc, "createConsumerManager", consumerDispatcher);
        return consumerDispatcher;
    }
987102
@Nonnull
	public static <T> LTieFltConsumerBuilder<T> tieFltConsumer(Consumer<LTieFltConsumer<T>> consumer) {
		return new LTieFltConsumerBuilder(consumer);
	}
215509
@Nonnull
	public static <T> LTieSrtConsumerBuilder<T> tieSrtConsumer(Consumer<LTieSrtConsumer<T>> consumer) {
		return new LTieSrtConsumerBuilder(consumer);
	}
466493
@Nonnull
	public static <R> LIntFunctionBuilder<R> intFunction(Consumer<LIntFunction<R>> consumer) {
		return new LIntFunctionBuilder(consumer);
	}
1206394
@Nonnull
	public static <T> LObjDblConsumerBuilder<T> objDblConsumer(Consumer<LObjDblConsumer<T>> consumer) {
		return new LObjDblConsumerBuilder(consumer);
	}
616491
@Nonnull
	public static <T> UnaryOperatorBuilder<T> unaryOperator(Consumer<UnaryOperator<T>> consumer) {
		return new UnaryOperatorBuilder(consumer);
	}
1087275
@Nonnull
	public static <T> LObjFltPredicateBuilder<T> objFltPredicate(Consumer<LObjFltPredicate<T>> consumer) {
		return new LObjFltPredicateBuilder(consumer);
	}
663474
@Nonnull
	public static <R> LSrtFunctionBuilder<R> srtFunction(Consumer<LSrtFunction<R>> consumer) {
		return new LSrtFunctionBuilder(consumer);
	}