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