Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Topic Commands

List Topics

Code Block
themeEmacs
kubectl exec -it ckaf-kafka-0 -- /bin/kafka-topics.sh --list --bootstrap-server ckaf-kafka-headless:9092



Create Topic

Code Block
themeEmacs
kubectl exec -it ckaf-kafka-0 -- /bin/kafka-topics.sh --bootstrap-server ckaf-kafka-headless:9092 --create --topic test


Publish Message

Code Block
themeEmacs
kubectl exec -it ckaf-kafka-0 -- /bin/kafka-console-topicsproducer.sh --bootstrap-server ckaf-kafka-headless:9092 --create --topic test2 --partitions 3test
Code Block
>{"log":"value"}


Publish Message from File

vi input.json

Code Block
{
  "log":"value",
  "two": "value2"
}


Code Block
themeEmacs
kubectl exec -it ckaf-kafka-0 -- /bin/kafka-console-producer.sh --bootstrap-server ckaf-kafka-headless:9092 --topic test
Code Block
>{"log":"value"} < input.json



Consume Messages

Code Block
themeEmacs
kubectl exec -it ckaf-kafka-0 -- /bin/kafka-console-consumer.sh --bootstrap-server ckaf-kafka-headless:9092 --topic test

...