Giter VIP home page Giter VIP logo

event-experiments's Introduction

How to test

  1. Start RabbitMQ with default username & password guest:guest
  2. Start one ore more terminals, go to ./worker and run go run .
    • Running the consumers (worker) first will ensure the creation of the queue
  3. Start one terminal, go to ./producer and run go run .

You will see that the workers will share the messages, like a queue.

Example output

Terminal consumer 1

go run .                  
2023/01/20 14:37:08 gorabbit INFO: Processing messages on 1 goroutines                                                                
2023/01/20 14:37:10 consumed: hello, world 0
2023/01/20 14:37:10 consumed: hello, world 2
2023/01/20 14:37:10 consumed: hello, world 4
2023/01/20 14:37:11 consumed: hello, world 6
2023/01/20 14:37:11 consumed: hello, world 9
2023/01/20 14:37:11 consumed: hello, world 10
2023/01/20 14:37:11 consumed: hello, world 12
2023/01/20 14:37:11 consumed: hello, world 14
2023/01/20 14:37:12 consumed: hello, world 16
2023/01/20 14:37:12 consumed: hello, world 18
2023/01/20 14:37:12 consumed: hello, world 21
2023/01/20 14:37:12 consumed: hello, world 23
2023/01/20 14:37:12 consumed: hello, world 25
2023/01/20 14:37:13 consumed: hello, world 27
2023/01/20 14:37:13 consumed: hello, world 29
2023/01/20 14:37:13 consumed: hello, world 30
2023/01/20 14:37:13 consumed: hello, world 32
2023/01/20 14:37:13 consumed: hello, world 34
2023/01/20 14:37:14 consumed: hello, world 36

Terminal consumer 2

go run .                                                                                                                                                                    1 ↵ ──(Fri,Jan20)─┘
2023/01/20 14:37:08 gorabbit INFO: Processing messages on 1 goroutines
2023/01/20 14:37:10 consumed: hello, world 1
2023/01/20 14:37:10 consumed: hello, world 3
2023/01/20 14:37:10 consumed: hello, world 5
2023/01/20 14:37:11 consumed: hello, world 7
2023/01/20 14:37:11 consumed: hello, world 8
2023/01/20 14:37:11 consumed: hello, world 11
2023/01/20 14:37:11 consumed: hello, world 13
2023/01/20 14:37:11 consumed: hello, world 15
2023/01/20 14:37:12 consumed: hello, world 17
2023/01/20 14:37:12 consumed: hello, world 19
2023/01/20 14:37:12 consumed: hello, world 20
2023/01/20 14:37:12 consumed: hello, world 22
2023/01/20 14:37:12 consumed: hello, world 24
2023/01/20 14:37:13 consumed: hello, world 26
2023/01/20 14:37:13 consumed: hello, world 28
2023/01/20 14:37:13 consumed: hello, world 31
2023/01/20 14:37:13 consumed: hello, world 33
2023/01/20 14:37:13 consumed: hello, world 35
2023/01/20 14:37:14 consumed: hello, world 37

Terminal producer

go run .                                                                                  
2023/01/20 14:32:48 gorabbit INFO: closing publisher...
2023/01/20 14:32:48 gorabbit INFO: closing connection manager...

event-experiments's People

Contributors

ecostack avatar

Watchers

 avatar  avatar

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.