Mvitimin / Microservices_study

Study for MSA
0 stars 0 forks source link

Apache Kafka #5

Closed Mvitimin closed 11 months ago

Mvitimin commented 1 year ago

image

image
Mvitimin commented 1 year ago

image

image
Mvitimin commented 1 year ago

https://github.com/Lucas24D/ordering-system

Mvitimin commented 12 months ago

image

Mvitimin commented 11 months ago

image

Mvitimin commented 11 months ago

ZooKeeper Commands: The Four Letter Words https://zookeeper.apache.org/doc/r3.1.2/zookeeperAdmin.html#sc_zkCommands

$ docker-compose -f common.yml -f zookeeper.yml up # 주키퍼 구동
$ echo ruok | nc localhost 2181 # 주키퍼 상태체크 
$ docker-compose -f common.yml -f kafka_cluster.yml up # 카프카 클러스터 구동
$ docker-compose -f common.yml -f init_kafka.yml up # 카프카 시작 

Kafka Manager http://localhost:9000/

image

Mvitimin commented 11 months ago

Docker Container Network Bridge https://itbhome.tistory.com/47

Mvitimin commented 11 months ago

Kafka programming

A.) KafkaTemplate is a spring component that wraps a Kafka Producer and provides method to easily produce data on kafka.

B.) To create a Kafka Consumer with spring, using a KafkaListener annotation on a simple method is enough.

C.) If my kafka topic has n partitions, I cannot use more than n threads to consume the data on topics.

D.) Kafka Consumer has a max poll records property that limits the number of records returned for a single poll.