Giter Club home page Giter Club logo

demo-event-sourcing-with-golang's Introduction

demo-event-sourcing-with-golang

Step 1 :: Start Kafka server

$bin/zookeeper-server-start.sh config/zookeeper.properties
$bin/kafka-server-start.sh config/server.properties

Step 2 :: Start Redis server

$docker container run -d -p 6379:6379 redis:alpine

Step 3 :: Start producer

$go run cmd/main.go --act producer

// Create new account = user1
->create###user1
->create###user2

Message: {Event:{AccId:3128d758-580c-4e0a-85e8-192db1ef954a Type:CreateEvent} AccName:user1}
Message: {Event:{AccId:201258f5-cd98-46a3-86fa-96379b096c4c Type:CreateEvent} AccName:user2}

// Deposit 1,000 THB to user1
->deposit###3128d758-580c-4e0a-85e8-192db1ef954a###1000


// Withdraw 500 THB from user1
->withdraw###3128d758-580c-4e0a-85e8-192db1ef954a###500


// Transfer 50 THB from user1 to user2
->transfer###3128d758-580c-4e0a-85e8-192db1ef954a###201258f5-cd98-46a3-86fa-96379b096c4c####50

Step 4 :: Start producer

$go run cmd/main.go --act consumer

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.