Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/yuanyu90221/rabbitmq_go_connect_demo


https://github.com/yuanyu90221/rabbitmq_go_connect_demo

Last synced: 16 days ago
JSON representation

Awesome Lists containing this project

README

        

# rabbitmq with golang

## introduction

This repository is about use RabbitMQ to implement a WorkQueue with addTask

## RabbitMQ with golang
## Consumer
This consumer create a go channel to consume the message from rabbitmq with queuename = 'add'

And use a goroutine to receive data from consume channel

And sum the data from channel

## Producer
This producer publish a the data to the rabbitmq with queuename = 'add'

the data contains 2 integer numbers, Number1, Number2

## Advantage of this pub/sub pattern

1 All the request will be queue on ampq until the consumer consume, less data loss

2 consumer and producer don't have to be connected directly and can be asynchronize handle

## reference article
[work-queue-with-go-and-rabbitmq](https://medium.com/@masnun/work-queue-with-go-and-rabbitmq-b8c295cde861)