Russell Bateman August 2019
A quick console demonstration; here are the steps:
$ cd /home/russ/Downloads/ApacheKafka
$ bin/zookeeper-server-start.sh config/zookeeper.properties
$ bin/kafka-server-start.sh config/server.properties
$ bin/kafka-topics.sh --create --bootstrap-server localhost:9092 --replication-factor 1 --partitions 1 --topic Demo
$ bin/kafka-topics.sh --list --bootstrap-server localhost:9092 Demo Test __consumer_offsets
$ bin/kafka-console-producer.sh --broker-list localhost:9092 --topic Demo >This is a test of the Emergency Broadcast System. >This is only a test. (Brought down consumer after second message received, then sent third message.) >This is the third message.
$ bin/kafka-console-consumer.sh --bootstrap-server localhost:9092 --from-beginning --topic Demo This is a test of the Emergency Broadcast System. This is only a test. ^C (Bring down consumer after second message received, then bring consumer back up, still with option from-beginning.) $ bin/kafka-console-consumer.sh --bootstrap-server localhost:9092 --from-beginning --topic Demo This is a test of the Emergency Broadcast System. This is only a test. This is the third message
$ sudo /opt/apache-zookeeper-3.5.6-bin/bin/zkServer.sh start /usr/bin/java ZooKeeper JMX enabled by default Using config: /opt/apache-zookeeper-3.5.6-bin/bin/../conf/zoo.cfg Starting zookeeper ... STARTED
~/Downloads/kafka $ sudo bash kafka # cp kafka_2.12-2.3.1.tgz /opt kafka # cd /opt /opt # tar -zxf kafka_2.12-2.3.1.tgz
kafka_2.12-2.3.1
Why? See bike-shedding.
message-type.dataset-name.data-name
...is limited to the set:
...include, of course, ASCII alphanumerics plus dot, hyphen and underscore.
The dataset name is analogous to the database name in an RDBMS. Think of it as a "category" for grouping topics. It's a sort of namespace.
Think of the data name as a table name in RDBMS. It's a good idea to include further dotted notation if more hierarchy would be useful within the dataset namespace.
This can be done by disabling auto.create.topics.enable and limiting who can create or how anyone can create topics.
Once a topic name is created, it cannot be changed.