diff --git a/samples/spring-cloud-stream-schema-registry-integration/schema-registry-producer1-kafka/src/main/java/sample/producer1/Producer1ApplicationKafka.java b/samples/spring-cloud-stream-schema-registry-integration/schema-registry-producer1-kafka/src/main/java/sample/producer1/Producer1ApplicationKafka.java index 9ad25864b..8e40bd74a 100644 --- a/samples/spring-cloud-stream-schema-registry-integration/schema-registry-producer1-kafka/src/main/java/sample/producer1/Producer1ApplicationKafka.java +++ b/samples/spring-cloud-stream-schema-registry-integration/schema-registry-producer1-kafka/src/main/java/sample/producer1/Producer1ApplicationKafka.java @@ -35,7 +35,7 @@ import org.springframework.web.bind.annotation.RestController; @RestController public class Producer1ApplicationKafka { - private Random random = new Random(); + private final Random random = new Random(); @Autowired private StreamBridge streamBridge; diff --git a/samples/spring-cloud-stream-schema-registry-integration/schema-registry-producer2-kafka/src/main/java/sample/producer2/Producer2ApplicationKafka.java b/samples/spring-cloud-stream-schema-registry-integration/schema-registry-producer2-kafka/src/main/java/sample/producer2/Producer2ApplicationKafka.java index 9a46c8a66..6c3225ccb 100644 --- a/samples/spring-cloud-stream-schema-registry-integration/schema-registry-producer2-kafka/src/main/java/sample/producer2/Producer2ApplicationKafka.java +++ b/samples/spring-cloud-stream-schema-registry-integration/schema-registry-producer2-kafka/src/main/java/sample/producer2/Producer2ApplicationKafka.java @@ -41,7 +41,7 @@ import com.example.Sensor; @RestController public class Producer2ApplicationKafka { - private Random random = new Random(); + private final Random random = new Random(); @Autowired private StreamBridge streamBridge; diff --git a/tools/kafka/docker-compose/README.adoc b/tools/kafka/docker-compose/README.adoc index c59e976c8..c79ab43fa 100644 --- a/tools/kafka/docker-compose/README.adoc +++ b/tools/kafka/docker-compose/README.adoc @@ -17,6 +17,26 @@ docker-compose -f ./kafka-cluster.yml down TIP: To start the containers in the foreground simply add `-d` to the start command. To stop containers that are running in the foreground simple issue `CTRL-C` command. +Running a quick test: + +Now that we started our clusters, let us try to produce data to a topic on the cluster and then consume from it. + +To produce data to a topic named `input-topic`: + +``` +docker exec -it broker1 /bin/kafka-console-producer --bootstrap-server localhost:29091 --topic input-topic +``` + +Note the use of bootstrap-server at `localhost:29091`. +This port is internal to the docker container. + +To consume from the `input-topic`: + +``` +docker exec -it broker1 /bin/kafka-console-consumer --bootstrap-server localhost:29091 --topic input-topic +``` + +Enter some data on the producer console and hit enter, you should see the same data gets echoed on the consumer console. === Control Center UI Runs a https://docs.confluent.io/platform/current/control-center/index.html[Confluent Control Center] that exposes a UI at http://locahost:9021.