<commit_before>package de.zalando.aruha.nakadi.repository.kafka;

import kafka.javaapi.consumer.SimpleConsumer;
import org.apache.kafka.clients.consumer.Consumer;
import org.apache.kafka.clients.consumer.KafkaConsumer;
import org.apache.kafka.clients.producer.KafkaProducer;
import org.apache.kafka.clients.producer.Producer;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.context.annotation.Bean;
import org.springframework.stereotype.Component;

import java.util.Properties;

@Component
class KafkaFactory {

    @Autowired
    @Qualifier("kafkaBrokers")
    private String kafkaAddress;

    @Autowired
    @Qualifier("zookeeperBrokers")
    private String zookeeperAddress;

	@Autowired
	private Producer<String, String> producer;
	@Autowired
	private Consumer<String, String> consumer;

	public KafkaFactory() {
	}

	@Bean
	public Producer<String, String> createProducer() {
		return new KafkaProducer(getProps());
	}

	@Bean
	public Consumer<String, String> createConsumer() {
		return new KafkaConsumer<>(getProps());
	}

	private Properties getProps() {
		final Properties props = new Properties();
		props.put("metadata.broker.list", zookeeperAddress);
		props.put("bootstrap.servers", kafkaAddress);
		props.put("value.serializer", "org.apache.kafka.common.serialization.StringSerializer");
		props.put("key.serializer", "org.apache.kafka.common.serialization.StringSerializer");
		props.put("value.deserializer", "org.apache.kafka.common.serialization.StringDeserializer");
		props.put("key.deserializer", "org.apache.kafka.common.serialization.StringDeserializer");

		return props;
	}

	public Producer<String, String> getProducer() {
		return producer;
	}
<commit_msg>ARUHA-32 small improvememts<commit_after>package de.zalando.aruha.nakadi.repository.kafka;

import kafka.javaapi.consumer.SimpleConsumer;
import org.apache.kafka.clients.consumer.Consumer;
import org.apache.kafka.clients.consumer.KafkaConsumer;
import org.apache.kafka.clients.producer.KafkaProducer;
import org.apache.kafka.clients.producer.Producer;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.context.annotation.Bean;
import org.springframework.stereotype.Component;

import java.util.Properties;

@Component
class KafkaFactory {

    @Autowired
    @Qualifier("kafkaBrokers")
    private String kafkaAddress;

    @Autowired
    @Qualifier("zookeeperBrokers")
    private String zookeeperAddress;

	@Autowired
	private Producer<String, String> producer;

	@Autowired
	private Consumer<String, String> consumer;

	public KafkaFactory() {
	}

	@Bean
	public Producer<String, String> createProducer() {
		return new KafkaProducer<>(getProps());
	}

	@Bean
	public Consumer<String, String> createConsumer() {
		return new KafkaConsumer<>(getProps());
	}

	private Properties getProps() {
		final Properties props = new Properties();
		props.put("metadata.broker.list", zookeeperAddress);
		props.put("bootstrap.servers", kafkaAddress);
		props.put("value.serializer", "org.apache.kafka.common.serialization.StringSerializer");
		props.put("key.serializer", "org.apache.kafka.common.serialization.StringSerializer");
		props.put("value.deserializer", "org.apache.kafka.common.serialization.StringDeserializer");
		props.put("key.deserializer", "org.apache.kafka.common.serialization.StringDeserializer");

		return props;
	}

	public Producer<String, String> getProducer() {
		return producer;
	}

{'fraction_non_alphanumeric': 0.11939883106039521, 'fraction_numerical': 0.0005566379070414695, 'mean_word_length': 5.92485549132948, 'pattern_counts': {'":': 0, '<': 16, '<?xml version=': 0, '>': 16, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '18428', 'n_tokens_mistral': 1129, 'n_tokens_neox': 1101, 'n_words': 184}