org.apache.kafka.common.serialization.Serdes.StringSerde Java Examples

The following examples show how to use org.apache.kafka.common.serialization.Serdes.StringSerde. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: KafkaStorageBuilder.java    From zipkin-storage-kafka with Apache License 2.0 5 votes vote down vote up
public SpanAggregationBuilder() {
  streamConfig.put(StreamsConfig.DEFAULT_KEY_SERDE_CLASS_CONFIG, StringSerde.class);
  streamConfig.put(StreamsConfig.DEFAULT_VALUE_SERDE_CLASS_CONFIG, ByteArraySerde.class);
  streamConfig.put(StreamsConfig.APPLICATION_ID_CONFIG, "zipkin-aggregation");
  streamConfig.put(StreamsConfig.STATE_DIR_CONFIG, "/tmp/zipkin-storage-kafka/aggregation");
  streamConfig.put(StreamsConfig.TOPOLOGY_OPTIMIZATION, StreamsConfig.OPTIMIZE);
}
 
Example #2
Source File: KafkaStorageBuilder.java    From zipkin-storage-kafka with Apache License 2.0 5 votes vote down vote up
public TraceStorageBuilder() {
  streamConfig.put(StreamsConfig.DEFAULT_KEY_SERDE_CLASS_CONFIG, StringSerde.class);
  streamConfig.put(StreamsConfig.DEFAULT_VALUE_SERDE_CLASS_CONFIG, ByteArraySerde.class);
  streamConfig.put(StreamsConfig.APPLICATION_ID_CONFIG, "zipkin-trace-storage");
  streamConfig.put(StreamsConfig.STATE_DIR_CONFIG, "/tmp/zipkin-storage-kafka/trace-storage");
  streamConfig.put(StreamsConfig.TOPOLOGY_OPTIMIZATION, StreamsConfig.OPTIMIZE);
  streamConfig.put(StreamsConfig.APPLICATION_SERVER_CONFIG, "localhost:9411");
}
 
Example #3
Source File: KafkaStorageBuilder.java    From zipkin-storage-kafka with Apache License 2.0 5 votes vote down vote up
public DependencyStorageBuilder() {
  // Dependency Store Stream Topology configuration
  streamConfig.put(StreamsConfig.DEFAULT_KEY_SERDE_CLASS_CONFIG, StringSerde.class);
  streamConfig.put(StreamsConfig.DEFAULT_VALUE_SERDE_CLASS_CONFIG, ByteArraySerde.class);
  streamConfig.put(StreamsConfig.APPLICATION_ID_CONFIG, "zipkin-dependency-storage");
  streamConfig.put(StreamsConfig.STATE_DIR_CONFIG, "/tmp/zipkin-storage-kafka/dependency-storage");
  streamConfig.put(StreamsConfig.TOPOLOGY_OPTIMIZATION, StreamsConfig.OPTIMIZE);
  streamConfig.put(StreamsConfig.APPLICATION_SERVER_CONFIG, "localhost:9411");
}
 
Example #4
Source File: NameJoinGlobalKTable.java    From fluent-kafka-streams-tests with MIT License 5 votes vote down vote up
public Properties getKafkaProperties() {
    final String brokers = "localhost:9092";
    final Properties kafkaConfig = new Properties();
    kafkaConfig.setProperty(StreamsConfig.APPLICATION_ID_CONFIG, "globalKTableJoin");
    kafkaConfig.setProperty(StreamsConfig.BOOTSTRAP_SERVERS_CONFIG, brokers);
    kafkaConfig.put(StreamsConfig.DEFAULT_KEY_SERDE_CLASS_CONFIG, LongSerde.class);
    kafkaConfig.put(StreamsConfig.DEFAULT_VALUE_SERDE_CLASS_CONFIG, StringSerde.class);
    return kafkaConfig;
}
 
Example #5
Source File: WindowFinalResult.java    From kafka-tutorials with Apache License 2.0 5 votes vote down vote up
public static Properties buildProperties(Config config) {
    Properties properties = new Properties();

    properties.put(StreamsConfig.BOOTSTRAP_SERVERS_CONFIG, config.getString("bootstrap.servers"));
    properties.put(StreamsConfig.APPLICATION_ID_CONFIG, config.getString("application.id"));
    properties.put(StreamsConfig.DEFAULT_VALUE_SERDE_CLASS_CONFIG, StringSerde.class);
    properties.put(StreamsConfig.DEFAULT_KEY_SERDE_CLASS_CONFIG, StringSerde.class);
    properties.put(ConsumerConfig.AUTO_OFFSET_RESET_CONFIG, "latest");
    properties.put(StreamsConfig.CACHE_MAX_BYTES_BUFFERING_CONFIG, 0);

    return properties;
}