No description, website, or topics provided.
Java
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
at-least-once
cqrs-async-eventual
cqrs-async-instantaneous
cqrs-sync-instantaneous
postman
resources
README.md

README.md

CQRS Demos

Week 1 slides
Week 2 slides
Week 3 slides

Other Topics

Eventual Consistency and CAP slides
Message Buses slides
Idempotency slides
Memoization slides
Partial Application slides
Database Isolation slides
Optimistic Concurrency slides
ACID slides

Running week 1 demo

  • Clone this repo
  • Install and startup MongoDb
  • Open cqrs-sync-instantaneous directory as maven project in IntelliJ
  • Run from IntelliJ with the following configuration:
  • Open Postman and import collection
  • Send "Create product CQRS Part 1"
  • Send "Get category CQRS Part 1"
  • Start mongo client from command line and run:
  • use products
  • db.products.find()
  • use categories
  • db.categories.find()

Running week 2 demo

  • Install and startup Kafka (assuming mac os... windows users are on their own :P)
    • Install Kafka- brew install kafka
    • Start Zookeeper- zookeeper-server-start /usr/local/etc/kafka/zookeeper.properties
    • Start Kafka- kafka-server-start /usr/local/etc/kafka/server.properties
    • Create topic called products- kafka-topics --create --zookeeper localhost:2181 --replication-factor 1 --partitions 1 --topic products
  • Start consumer- kafka-console-consumer --bootstrap-server localhost:9092 --topic products
  • Follow instructions for Week 1 except for project cqrs-async-instantaneous and change postman requests to port 9000

Running week 3 demo

  • Startup Kafka (assuming mac os... windows users are on their own :P)
    • Start Zookeeper- zookeeper-server-start /usr/local/etc/kafka/zookeeper.properties
    • Start Kafka- kafka-server-start /usr/local/etc/kafka/server.properties
    • Create topics called product_events and product_commands-
      • kafka-topics --create --zookeeper localhost:2181 --replication-factor 1 --partitions 1 --topic product_events
      • kafka-topics --create --zookeeper localhost:2181 --replication-factor 1 --partitions 1 --topic product_commands
    • Run Mongo as a cluster (we need this to generate oplog)
      • mongod --config /usr/local/etc/mongod.conf --port 27017 --dbpath /srv/mongodb/db0 --replSet rs0
    • Initiate replica set
      • rs.initiate({_id:"rs0", members: [{"_id":1, "host":"localhost:27017"}]})
    • Follow instructions for Week 1 except for project cqrs-async-instantaneous and change postman requests to port 9080