Giter VIP home page Giter VIP logo

simple-message-app-with-rabbitmq's Introduction

Presentation

Hello, this is a simple app to present RabbitMQ with Ruby on Rails. With then you can create producers and consumers, and send messages in a queue to be consumed. This repository is used into https://blog.codeminer42.com/event-driven-architecture-2-our-first-app-with-rabbitmq/

Setup

Requirements:

  • Docker and Docker compose

To install and run the containers execute them in your terminal:

$ docker-compose build and $ docker-compose up

and now you have executed a container with ruby and another one with RabbitMQ service.

Usage

➡️ To open the container with ruby bash you can use docker exec -it CONTAINER_NAME bash. After opening the container bash, you can open a Rails console instance and then use the app classes/methods.

➡️ To open an rails console: ./bin/rails c

➡️ To send a message to the queue you can execute it in a rails console:

RabbitMq::Client::Publisher.new.publish_message 'hey'

➡️ To listen to the messages, you can execute them in another Rails console instance:

RabbitMq::Client::Receiver.new.listen_messages

Testing

To run the tests you can execute them in a console instance:

bundle exec rspec

simple-message-app-with-rabbitmq's People

Contributors

carlosdanielpohlod avatar carlospohlodcodeminer42 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.