Advertisement
sergAccount

Untitled

Aug 8th, 2020
901
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 1.29 KB | None | 0 0
  1. /*
  2.  * To change this license header, choose License Headers in Project Properties.
  3.  * To change this template file, choose Tools | Templates
  4.  * and open the template in the editor.
  5.  */
  6. package com.spec.service;
  7.  
  8. import java.util.Properties;
  9. import org.apache.kafka.common.serialization.Serdes;
  10. import org.apache.kafka.streams.StreamsConfig;
  11.  
  12. public class SreamsKafkaConfig {    
  13.     //
  14.     public static String getInputTopic(){
  15.         return "source-topic";
  16.     }
  17.     //
  18.     public static String getOutputTopic(){        
  19.         return "dst-topic";
  20.     }        
  21.     // возвращает объект типа Properties
  22.     public static Properties getConfig(){
  23.        //ProducerConfig.BOOTSTRAP_SERVERS_CONFIG
  24.         final Properties properties = new Properties();
  25.         properties.put(StreamsConfig.BOOTSTRAP_SERVERS_CONFIG, "localhost:9092");        
  26.         properties.put(StreamsConfig.APPLICATION_ID_CONFIG, "stream-example1");        
  27.         properties.put(StreamsConfig.DEFAULT_KEY_SERDE_CLASS_CONFIG,   Serdes.String().getClass().getName());
  28.         properties.put(StreamsConfig.DEFAULT_VALUE_SERDE_CLASS_CONFIG, Serdes.String().getClass().getName());
  29.         //                
  30.         // test-consumer-group
  31.         //
  32.         return properties;        
  33.     }
  34. }
  35.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement