davidradl commented on code in PR #26789: URL: https://github.com/apache/flink/pull/26789#discussion_r2419046742
########## docs/content/docs/dev/table/sql/examples/kafka-to-kafka/kafka-to-kafka.md: ########## @@ -0,0 +1,132 @@ +## Kafka to Kafka Example with Flink SQL + +This example demonstrates how to use **Apache Flink SQL** to consume JSON messages from a Kafka topic, **transform and filter** the data, and then produce the output to another Kafka topic. + +--- + +## Set Up Kafka Topics + +You can use the Kafka Docker container to create the required topics. + +> ℹ️ This example assumes you're running Kafka via Docker. If not, adjust the paths accordingly. +> +> The Kafka Docker image can be pulled from [Docker Hub](https://hub.docker.com/r/bitnami/kafka) or [Confluent](https://hub.docker.com/r/confluentinc/cp-kafka). + +```bash +# Create input topic +docker exec -it docker-kafka-1 /opt/kafka/bin/kafka-topics.sh \ + --create \ + --topic input-topic \ + --bootstrap-server localhost:9092 \ + --partitions 1 \ + --replication-factor 1 + +# Create output topic +docker exec -it docker-kafka-1 /opt/kafka/bin/kafka-topics.sh \ + --create \ + --topic output-topic \ + --bootstrap-server localhost:9092 \ + --partitions 1 \ + --replication-factor 1 +```` +--- + +## Producer Script + +Run the following Python script to send JSON messages to the `input-topic`. + +```bash +python producer.py Review Comment: where do I find producer.py and consumer.py? -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
