mirror of https://github.com/apache/kafka.git
MINOR: Get console output in quickstart examples (#12719)
Quickstart examples didn't produce any console output, since it was missing a logger implementation in the classpath. Also some minor cleanups. Tested by creating a test project and running the code.
This commit is contained in:
parent
215d4f93bd
commit
732887b210
|
@ -30,8 +30,7 @@
|
||||||
<properties>
|
<properties>
|
||||||
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
||||||
<kafka.version>3.4.0-SNAPSHOT</kafka.version>
|
<kafka.version>3.4.0-SNAPSHOT</kafka.version>
|
||||||
<slf4j.version>1.7.7</slf4j.version>
|
<slf4j.version>1.7.36</slf4j.version>
|
||||||
<log4j.version>1.2.17</log4j.version>
|
|
||||||
</properties>
|
</properties>
|
||||||
|
|
||||||
<repositories>
|
<repositories>
|
||||||
|
@ -126,6 +125,12 @@
|
||||||
</build>
|
</build>
|
||||||
|
|
||||||
<dependencies>
|
<dependencies>
|
||||||
|
<!-- To enable console logging -->
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.slf4j</groupId>
|
||||||
|
<artifactId>slf4j-reload4j</artifactId>
|
||||||
|
<version>${slf4j.version}</version>
|
||||||
|
</dependency>
|
||||||
<!-- Apache Kafka dependencies -->
|
<!-- Apache Kafka dependencies -->
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.apache.kafka</groupId>
|
<groupId>org.apache.kafka</groupId>
|
||||||
|
|
|
@ -35,7 +35,7 @@ import java.util.concurrent.CountDownLatch;
|
||||||
*/
|
*/
|
||||||
public class LineSplit {
|
public class LineSplit {
|
||||||
|
|
||||||
public static void main(String[] args) throws Exception {
|
public static void main(String[] args) {
|
||||||
Properties props = new Properties();
|
Properties props = new Properties();
|
||||||
props.put(StreamsConfig.APPLICATION_ID_CONFIG, "streams-linesplit");
|
props.put(StreamsConfig.APPLICATION_ID_CONFIG, "streams-linesplit");
|
||||||
props.put(StreamsConfig.BOOTSTRAP_SERVERS_CONFIG, "localhost:9092");
|
props.put(StreamsConfig.BOOTSTRAP_SERVERS_CONFIG, "localhost:9092");
|
||||||
|
|
|
@ -26,13 +26,13 @@ import java.util.Properties;
|
||||||
import java.util.concurrent.CountDownLatch;
|
import java.util.concurrent.CountDownLatch;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* In this example, we implement a simple LineSplit program using the high-level Streams DSL
|
* In this example, we implement a simple Pipe program using the high-level Streams DSL
|
||||||
* that reads from a source topic "streams-plaintext-input", where the values of messages represent lines of text,
|
* that reads from a source topic "streams-plaintext-input", where the values of messages represent lines of text,
|
||||||
* and writes the messages as-is into a sink topic "streams-pipe-output".
|
* and writes the messages as-is into a sink topic "streams-pipe-output".
|
||||||
*/
|
*/
|
||||||
public class Pipe {
|
public class Pipe {
|
||||||
|
|
||||||
public static void main(String[] args) throws Exception {
|
public static void main(String[] args) {
|
||||||
Properties props = new Properties();
|
Properties props = new Properties();
|
||||||
props.put(StreamsConfig.APPLICATION_ID_CONFIG, "streams-pipe");
|
props.put(StreamsConfig.APPLICATION_ID_CONFIG, "streams-pipe");
|
||||||
props.put(StreamsConfig.BOOTSTRAP_SERVERS_CONFIG, "localhost:9092");
|
props.put(StreamsConfig.BOOTSTRAP_SERVERS_CONFIG, "localhost:9092");
|
||||||
|
|
|
@ -41,7 +41,7 @@ import java.util.concurrent.CountDownLatch;
|
||||||
*/
|
*/
|
||||||
public class WordCount {
|
public class WordCount {
|
||||||
|
|
||||||
public static void main(String[] args) throws Exception {
|
public static void main(String[] args) {
|
||||||
Properties props = new Properties();
|
Properties props = new Properties();
|
||||||
props.put(StreamsConfig.APPLICATION_ID_CONFIG, "streams-wordcount");
|
props.put(StreamsConfig.APPLICATION_ID_CONFIG, "streams-wordcount");
|
||||||
props.put(StreamsConfig.BOOTSTRAP_SERVERS_CONFIG, "localhost:9092");
|
props.put(StreamsConfig.BOOTSTRAP_SERVERS_CONFIG, "localhost:9092");
|
||||||
|
|
Loading…
Reference in New Issue