Uploaded image for project: 'Kafka'
  1. Kafka
  2. KAFKA-8348

Document of kafkaStreams improvement

    XMLWordPrintableJSON

    Details

    • Type: Improvement
    • Status: Resolved
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 1.0.0, 1.0.1, 1.0.2, 1.1.0, 1.1.1, 2.0.0, 2.0.1, 2.1.0, 2.2.0, 2.1.1
    • Fix Version/s: 1.0.3, 1.1.2, 2.0.2, 2.3.0, 2.1.2, 2.2.1
    • Component/s: documentation, streams
    • Labels:
      None

      Description

      there is an out of date and error example in kafkaStreams.java for current version.

      • Map is not supported for initial StreamsConfig properties
      • `int` does not support `toString`

      related code:

      // kafkaStreams.java
      
      * <p>
      * A simple example might look like this:
      * <pre>{@code
      * Properties props = new Properties();
      * props.put(StreamsConfig.APPLICATION_ID_CONFIG, "my-stream-processing-application");
      * props.put(StreamsConfig.BOOTSTRAP_SERVERS_CONFIG, "localhost:9092");
      * props.put(StreamsConfig.DEFAULT_KEY_SERDE_CLASS_CONFIG, Serdes.String().getClass());
      * props.put(StreamsConfig.DEFAULT_VALUE_SERDE_CLASS_CONFIG, Serdes.String().getClass());
      *
      * StreamsBuilder builder = new StreamsBuilder();
      * builder.<String, String>stream("my-input-topic").mapValues(value -> String.valueOf(value.length())).to("my-output-topic");
      *
      * KafkaStreams streams = new KafkaStreams(builder.build(), props);
      * streams.start();
      * }</pre>

       

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                hustclf Lifei Chen
                Reporter:
                hustclf Lifei Chen
              • Votes:
                0 Vote for this issue
                Watchers:
                4 Start watching this issue

                Dates

                • Due:
                  Created:
                  Updated:
                  Resolved: