Kafka-producer. and consumer. and topic

springdeMacBook-Pro:bin spring$ cd /Users/spring/Downloads/kafka_2.12-1.1.0/bin
springdeMacBook-Pro:bin spring$ sh kafka-topics.sh --create --zookeeper localhost:2181 --replication-factor 1 --partitions 1 --topic test
Created topic "test".
springdeMacBook-Pro:bin spring$ sh kafka-console-producer.sh --broker-list localhost:9092 --topic test
>
>
>ok
>producer input test
>

--------------------------------


springdeMacBook-Pro:bin spring$ cd /Users/spring/Downloads/kafka_2.12-1.1.0/bin
springdeMacBook-Pro:bin spring$ sh kafka-console-consumer.sh --zookeeper localhost:2181 --topic test --from-beginning
Using the ConsoleConsumer with old consumer is deprecated and will be removed in a future major release. Consider using the new consumer by passing [bootstrap-server] instead of [zookeeper].

ok
producer input test




---------------------------------



springdeMacBook-Pro:bin spring$ cd /Users/spring/Downloads/kafka_2.12-1.1.0/bin
springdeMacBook-Pro:bin spring$ sh kafka-topics.sh --list --zookeeper localhost:2181
test
springdeMacBook-Pro:bin spring$ sh kafka-topics.sh --list --zookeeper localhost:2181
__consumer_offsets
springCloudBus
test
springdeMacBook-Pro:bin spring$










你可能感兴趣的:(kafka)