Thanks to visit codestin.com
Credit goes to www.scribd.com

0% found this document useful (0 votes)
11 views14 pages

Kafka

The document outlines the setup and usage of Kafka for event sourcing architecture, including commands for creating topics, listing them, and producing and consuming messages. It highlights the importance of message order within partitions and the lack of global order across multiple partitions. Additionally, it mentions the role of consumers in subscribing to topics and introduces the concept of CQRS (Command Query Responsibility Segregation) in relation to a payment model using traditional methods and Kafka.

Uploaded by

lakhdip.singh
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
11 views14 pages

Kafka

The document outlines the setup and usage of Kafka for event sourcing architecture, including commands for creating topics, listing them, and producing and consuming messages. It highlights the importance of message order within partitions and the lack of global order across multiple partitions. Additionally, it mentions the role of consumers in subscribing to topics and introduces the concept of CQRS (Command Query Responsibility Segregation) in relation to a payment model using traditional methods and Kafka.

Uploaded by

lakhdip.singh
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 14

Event sourcing architecture

./bin/kafka-topics.sh --create --topic my-topic --zookeeper localhost:2181 --replication-factor 1 --


partitions 1

./bin/kafka-topics.sh --list --zookeeper localhost:2181

./bin/kafka-console-producer.sh --broker-list localhost:9092 --topic my_topic

./bin/kafka-console-consumer.sh --bootstrap-server localhost:9092 --topic my_topic --from-


beginning

Notes

Msg order (based timestamp) with in a partition

Global order is not there if TOPIC has multiple partitions, consumer uses a offset to read the
messages in a particular order.
Consumers

- Subscribes to one or more topics.


- Methods –
o subscribe(reg-exp [like my*] OR list of topics)
o assign -> to subscribe a particular partition
CQRS- command query responsibility segregation.

Payment Model with Traditional & Kafka

You might also like