.\bin\windows\zookeeper-server-start.bat .\config\zookeeper.properties 명령어를 실행한다
이러한 화면이 나타나면 정상 실행된것이다.
.\bin\windows\kafka-server-start.bat .\config\server.properties 명령어를 실행한다.
이러한 화면이 나타나면 잘 실행된 것이다.
1.powershell을 실행한다.
2.카프카가 설치된 곳으로 디렉토를 변경한다.
3.kafka-topics.bat 파일을 이용하면 토픽을 생성하는 기능을 제공한다. 명령어를 실행한다.
.\bin\windows\kafka-topics.bat --create --topic topice-example1 --bootstrap-server=localhost:9092
Created topic topice-example1.
--bootstrap-server을 이용하여 포트및 서버를 설정할 수 있다.
1.powershell을 실행한다.
2.카프카가 설치된 곳으로 디렉토를 변경한다.
3. --create 대신 --describe 명령어로 변경한다
.\bin\windows\kafka-topics.bat --describe --topic topice-example1 --bootstrap-server=localhost:9092
이러한 생성된 토픽을 확인할 수 있다.
1.powershell을 실행한다.
2.카프카가 설치된 곳으로 디렉토를 변경한다.
3. kafka-console-producer을 이용하여 메시지를 발행한다
\kafka> .\bin\windows\kafka-console-producer.bat --topic topic-example1 --bootstrap-server=localhost:9092
1.powershell을 실행한다.
2.카프카가 설치된 곳으로 디렉토를 변경한다.
3.kafka-console.consumer을 이용하여 메세지를 확인한다
.\bin\windows\kafka-console-consumer.bat --topic topic-example1 --from-beginning --bootstrap-server=localhost:9092
--from-beginning 을 설정하지 않으면 consumer가 접속한 시점부터 메시지를 발행 받으면 설정시 이전의 메시지도 확인 가능하다.
consumer 실행하면 producer가 발행한 메세지를 준 실시간적으로 메세지를 받아 볼 수 있다.