All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.networknt.eventuate.kafka.consumer.ConsumerPropertiesFactory Maven / Gradle / Ivy

There is a newer version: 2.0.11
Show newest version
package com.networknt.eventuate.kafka.consumer;

import com.networknt.eventuate.kafka.KafkaConfig;

import java.util.Properties;

public class ConsumerPropertiesFactory {
  public static Properties makeConsumerProperties(KafkaConfig config, String subscriberId) {
    Properties consumerProperties = new Properties();
    consumerProperties.put("bootstrap.servers", config.getBootstrapServers());
    consumerProperties.put("group.id", subscriberId);
    consumerProperties.put("enable.auto.commit", config.isEnableaAutocommit());
    consumerProperties.put("session.timeout.ms", config.getSessionTimeout());
    consumerProperties.put("key.deserializer", config.getKeyDeSerializer());
    consumerProperties.put("value.deserializer", config.getValueDeSerializer());
    consumerProperties.put("auto.offset.reset", config.getAutoOffsetreset());
    return consumerProperties;
  }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy