Git Product home page Git Product logo

gorabbit's Introduction

gorabbit

Go and RabbitMQ

Exploring RabbitMQ with Go

This project consists of a few different RabbitMQ programs to explore the basics ideas around working with producers, consumers, and queues in RabbitMQ.

Producer / Consumer

graph LR;
    producer((("Sender.go")))
    queue["gorabbit Queue"]
    consumer((("Consumer.go")))
    producer --> queue --> consumer
Loading

The sender.go program is a simple producer, that sends messages to the queue named "gorabbit". The consumer.go is a simple consumer that will continually attempt to read any messages waiting in the queue "gorabbit".

Task / Worker

graph LR;
    task((("Task.go")))
    queue["task Queue"]
    worker((("Worker.go" A)))
    worker2((("Worker.go" B)))
    task --> queue
    queue --> worker
    queue --> worker2
    
Loading

The task.go program takes an argument where any N number of . represents work in terms of seconds in which the receiving worker node will wait:

go run cmd/task/task.go work...

This will result in the consuming worker node to sleep for 3 seconds, upon receiving this message.

Not much has changed from the original consumer in the first examples. The only addition for the worker.go is that we parse the number of '.' within the message to determine how long it should wait.

gorabbit's People

Contributors

tnaucoin avatar

Watchers

 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.