GithubHelp home page GithubHelp logo

gorabbit's Introduction

POC for playing with RabbitMQ and Constant Hash Exchange Plugin

Pre requirements

  • MacOS
  • Docker installed
  • go1.14.1
  • Nomad installed

Quick Start

Start Nomad agent

nomad agent -dev -bind 0.0.0.0 -log-level DEBUG -dc local

Check Nomad is up by visiting: http://localhost:4646/ui/jobs

All the commands hsould be run from this directiry:

path_to_repository/gorabbit/infra/cli

Run this command to start RabbitMQ

go run cli.go SystemUp

It will start the Nomad job and download RabbitMQ image and run it.

Visit the RabbitMQ UI: http://127.0.0.1:15672/

Username: user Password: bitnami

Then install the consumers:

go run cli.go install

Run consumers

go run cli.go up

New jobs in Nomad will be started. You will see it in UI.

Run producer (change path to the repository)

export RABBITMQ_CONNECTION_STRING=amqp://user:bitnami@localhost:5672
export WORKING_DIRECTORY=/path_to_repository/gorabbit
export TOPIC=orders producer
producer

CLI

Run these commands form the ../gorabbit/infra/cli directory, cause internal paths are relative to it

Build and install producer and consumer globally

go run cli.go install

To generate new mappings from the infra/cli/manifest.json file run:

go run cli.go remap

Start RabbitMQ

go run cli.go systemUp

Start consumers

go run cli.go up

Then, you can change the instance number inside the infra/cli/manifest.json , and rescale.

go run cli.go rescale

This command will regenerate the mappings, update the Nomad job files and restart the jobs.

For other available commands look to the file infra/cli/magefile.go

gorabbit's People

Contributors

spaiz avatar

Stargazers

Jure Žvelc 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.