티스토리 뷰

개발

kafka 기초 sample로 학습하기

달리는개발자 2022. 12. 15. 23:13

kafka 기초 학습을 위해서 우선 아래 사이트에서 kafka 설치를 한다.

https://kafka.apache.org/quickstart

 

Apache Kafka

Apache Kafka: A Distributed Streaming Platform.

kafka.apache.org

 

위에 예제 중에 consumer, publisher sh로 학습을 해도 되지만 이미 많은 example 들이 있는 github repository 들이 있다.

아래 kafka github에 있는 examples 들을 받아서 내부 설정등을 바꿔가며 확인한다.

https://github.com/apache/kafka.git

 

GitHub - apache/kafka: Mirror of Apache Kafka

Mirror of Apache Kafka. Contribute to apache/kafka development by creating an account on GitHub.

github.com

 

confluentinc example

https://github.com/confluentinc/examples

 

GitHub - confluentinc/examples: Apache Kafka and Confluent Platform examples and demos

Apache Kafka and Confluent Platform examples and demos - GitHub - confluentinc/examples: Apache Kafka and Confluent Platform examples and demos

github.com

 

confluent java code example

https://docs.confluent.io/platform/current/tutorials/examples/clients/docs/java.html?utm_source=github&utm_medium=demo&utm_campaign=ch.examples_type.community_content.clients-ccloud

 

Java: Code Example for Apache Kafka® | Confluent Documentation

Home Platform Get Started with Kafka Videos, Demos, and Reading Material Confluent Cloud Examples Index Code Examples for Apache Kafka® Java: Code Example for Apache Kafka® In this tutorial, you will run a Java client application that produces messages t

docs.confluent.io

 

kafka stream은 확실히 예제코드를 보면서 익히는게 도움이 많이 된다.

https://docs.confluent.io/platform/current/streams/code-examples.html#streams-code-examples

 

Streams Code Examples | Confluent Documentation

Home Platform ksqlDB and Kafka Streams Kafka Streams Streams Code Examples If you’re new to Kafka Streams, here is a curated list of resources to get you started.

docs.confluent.io

 

topic 생성 등 명령어들을 치기 귀찮으면 로컬환경에 CMAK(Cluster Manager for Apache Kafka) 를 설치한다.

 

GitHub - yahoo/CMAK: CMAK is a tool for managing Apache Kafka clusters

CMAK is a tool for managing Apache Kafka clusters. Contribute to yahoo/CMAK development by creating an account on GitHub.

github.com

 

README.md를 확인해서 application.conf zookeeper 주소 변경하고 아래 명령어 실행한다.

./sbt clean dist

멈춰있는 듯 하지만 조금 기다리면 완료되고 아래와 같이 target 디렉토리 밑에 cmak-version.zip 으로 빌드된 파일이 생성됨.

적당한 위치에 옮겨서 아래 명령어로 띄우고 브라우저에서 localhost:9000 으로 접속한다.

bin/cmak

 

 

kafka 학습을 위한 준비는 모두 끝 ^^

반응형
댓글
반응형
공지사항
최근에 올라온 글
최근에 달린 댓글
Total
Today
Yesterday
«   2024/05   »
1 2 3 4
5 6 7 8 9 10 11
12 13 14 15 16 17 18
19 20 21 22 23 24 25
26 27 28 29 30 31
글 보관함