Download & Install
tar -xzf kafka_2.13-3.5.0.tgz
cd kafka_2.13-3.5.0
Setup
setup zookeeper
$ bin/zookeeper-server-start.sh config/zookeeper.properties
setup kafka
$ bin/kafka-server-start.sh config/server.properties
Create A Topic
$ bin/kafka-topics.sh --create --topic quickstart-events --bootstrap-server localhost:9092
Write Events To Topic
$ bin/kafka-console-producer.sh --topic quickstart-events --bootstrap-server localhost:9092
> this is first event
> this is second event
> Ctrl+C
# stop producer clientRead Events From Topic
$ bin/kafka-console-consumer.sh --topic quickstart-events --from-beginning --bootstrap-server localhost:9092
this is first event
this is second event
Ctrl+C
# stop consumer client
Dependencies
Install
$ sudo vi /etc/redis/redis.conf
change
bind
for remoting connect, changeprotected-mode no
for no auth.
$ sudo systemctl enable redis-server
enable redis service unit
$ sudo systemctl restart redis
restart redis serverCheck Installation
$ redis-cli
127.0.0.1:6379> set hello redis
127.0.0.1:6379> get hello
"redis"
redis gui
<!-- dependency -->
<dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-data-redis</artifactId>
</dependency>
</dependencies>