Advertisement
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 java.util.Properties;
- import org.apache.kafka.common.serialization.Serdes;
- import org.apache.kafka.streams.StreamsConfig;
- public class SreamsKafkaConfig {
- //
- public static String getInputTopic(){
- return "source-topic";
- }
- //
- public static String getOutputTopic(){
- return "dst-topic";
- }
- // возвращает объект типа Properties
- public static Properties getConfig(){
- //ProducerConfig.BOOTSTRAP_SERVERS_CONFIG
- final Properties properties = new Properties();
- properties.put(StreamsConfig.BOOTSTRAP_SERVERS_CONFIG, "localhost:9092");
- properties.put(StreamsConfig.APPLICATION_ID_CONFIG, "stream-example1");
- properties.put(StreamsConfig.DEFAULT_KEY_SERDE_CLASS_CONFIG, Serdes.String().getClass().getName());
- properties.put(StreamsConfig.DEFAULT_VALUE_SERDE_CLASS_CONFIG, Serdes.String().getClass().getName());
- //
- // test-consumer-group
- //
- return properties;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement