rabbit

package module
v0.0.0-...-f947bce Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 8, 2020 License: MIT Imports: 4 Imported by: 0

README

RabbitMQ

Este proyecto tiene como objetivo realizar una introducción a RabbitMQ 🎯

Go Report Card

Instalación de RabbitMQ

Puedes ejecutar un contenedor de Docker con el siguiente comando:

docker run -it --rm --name rabbitmq -p 5672:5672 -p 15672:15672 rabbitmq:3-management

Una vez que descargue la imagen y se levante el contenedor, puedes acceder al dashboard: http://localhost:15672. Las credenciales por defecto son guest/guest.

También puedes usar https://www.cloudamqp.com/ y generar una instancia gratuita de RabbitMQ.

Ejemplos:

Job

El objetivo del Job es enviar mensajes a una cola, mediante el uso de las librerías sender y receiver almacenadas en este repositorio. El ejemplo se debe correr de forma local. (por ahora)

Requisitos:
  • Elasticsearch
docker run -p 9200:9200 -p 9300:9300 -e "discovery.type=single-node" docker.elastic.co/elasticsearch/elasticsearch:7.6.2  
  • RabbitMQ
docker run -it --rm --name rabbitmq -p 5672:5672 -p 15672:15672 rabbitmq:3-management
  • Variable de entorno
RABBIT_URL=amqp://guest:guest@localhost:5672/

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Decode

func Decode(msg *[]byte, m *interface{})

Decode This function decode message from mq queue

func Encode

func Encode(m interface{}) *[]byte

Encode This function encode message to send mq queue

func SendMsg

func SendMsg(queueName string, message interface{}) error

SendMsg allow send a message to queue. AMQP URL must be defined in the environment variable "RABBIT_URL"

Types

type UpdatesChannel

type UpdatesChannel <-chan interface{}

func ReceiveMsg

func ReceiveMsg(queue string) UpdatesChannel

ReceiveMsg allow receibe a message from a queue. AMQP URL must be defined in the environment variable "RABBIT_URL"

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL