Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*
- * To change this license header, choose License Headers in Project Properties.
- * To change this template file, choose Tools | Templates
- * and open the template in the editor.
- */
- package com.spec.service;
- import com.spec.serializers.CustomerSerializer;
- import java.util.Properties;
- import org.apache.kafka.clients.producer.ProducerConfig;
- /**
- *
- * @author Administrator
- */
- public class CustomerKafkaConfig {
- // используется CustomerSerializer
- //
- public static Properties getConfig(){
- //
- //String s = ProducerConfig.BOOTSTRAP_SERVERS_CONFIG;
- final Properties properties = new Properties();
- properties.put("bootstrap.servers", "localhost:9092");
- //properties.put(ProducerConfig.ACKS_CONFIG, "1");
- //properties.put(ProducerConfig.RETRIES_CONFIG, "1");
- //properties.put(ProducerConfig.REQUEST_TIMEOUT_MS_CONFIG, "1");
- //properties.put(ProducerConfig.BOOTSTRAP_SERVERS_CONFIG, "localhost:9092,192.168.22.12:9088,localhost:7898");
- properties.put(ProducerConfig.KEY_SERIALIZER_CLASS_CONFIG, "org.apache.kafka.common.serialization.StringSerializer");
- properties.put(ProducerConfig.VALUE_SERIALIZER_CLASS_CONFIG , CustomerSerializer.class.getName());
- //
- return properties;
- }
- }
Add Comment
Please, Sign In to add comment