consumer

command module
v0.0.0-...-3698e2f Latest Latest
Warning

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

Go to latest
Published: Jun 14, 2020 License: MIT Imports: 3 Imported by: 0

README

GO-RABBITMQ-RAJA

Practicing RabbitMQ Using Golang with Go Mod as Programming Language, RabbitMQ as Messaging

Directory structure

Your project directory structure should look like this

  + your_gopath/
  |
  +--+ src/github.com/moemoe89
  |  |
  |  +--+ go-rabbitmq-raja/
  |     |
  |     +--+ consumer
  |     |  |
  |     |  +--+ config/
  |     |  +--+ main.go
  |     |  +--+ ... any other source code
  |     +--+ producer
  |        |
  |        +--+ config/
  |        +--+ main.go
  |        +--+ ... any other source code
  |
  +--+ bin/
  |  |
  |  +-- ... executable file
  |
  +--+ pkg/
     |
     +-- ... all dependency_library required

Requirements

Go >= 1.11

Setup and Build

$ mkdir -p src/github.com/moemoe89
$ cd src/github.com/moemoe89
$ git clone <url>
$ mv <cloned directory> go-rabbitmq-raja

Running Application

Make config file inside producer & consumer dir :

$ cp config-sample.json config.json

Change RabbitMQ address & collection based on your config :

amqp://guest:guest@rabbitmq:5672/

Build producer / consumer inside dir :

$ go build

Run producer / consumer inside dir :

$ go run main.go

How to Run with Docker

Make config file inside producer & consumer dir for docker :

$ cp config-sample.json config.json

Change RabbitMQ address & collection based on your docker config :

amqp://guest:guest@rabbitmq:5672/

Build

$ docker-compose build

Run

$ docker-compose up

Stop

$ docker-compose down

Trigger the message by opening this url on browser :

localhost:8781

Documentation

The Go Gopher

There is no documentation for this package.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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