JohnBat26 / rabbitmq_showcase

A little Rails app to consume and display messages from a running RabbitMQ message broker.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

rabbitmq_showcase

A little Rails app to consume and display messages from a running RabbitMQ message broker. For further explanation, see the blog posts here and the corresponding Java program: RabbitMQTestdriver.

Setup

Standard Rails: Clone the repo, bundle install, configure your database etc.

Features

Displayed features of RabbitMQ correspond to menu entries in the app. The app implements various messaging scenarios, partly taken from the official RabbitMQ tutorial. First simple functionalities are implemented using the Bunny gem, workflows are incorporated using Sneakers.io. All the app does is consuming incoming messages (with or without delay) and persisting them into the database. Inserted records are displayed in tables on their corresponding page. The contents of the tables refresh themselves in case you flooded the system with ten thousands of messages. By clicking on "Delete Records" on each page all messages regarding this particular showcase are wiped from the database.

Smoke test

settings.png

Self-explanatory. Note that only messages sent to the queue named "default" will show up, all others will pile up in the broker.

Topics

settings.png

This page features three tables to display messages that were sent to the topic exchange "log". The hints on the page indicate that there are three different listeners for messages that are equipped with certain routing keys. In the somewhat contrived 'logging' scenario you can deliver messages to only one ore multiple queues at once by entering the correct routing key in the corresponding Java program.

Worker queue

settings.png

Functionality shown on this page maps more or less directly to the work queue example of the RabbitMQ tutorial. The message will be consumed by the Rails app after the given amount of seconds.

Workflow

settings.png

Like stated on the hint, the Rails app uses Sneakers.io to simulate interdependent workflows and re-enqueuing of failed messages. The message text will show up in the Rails app only if it has been acknowledged by the first and second Sneakers.io worker. To make things more fun, the messages will be delayed, rejected 1/10th of the time and re-enqueued automatically, which is observed best by flooding the queues with hundreds of random messages.

About

A little Rails app to consume and display messages from a running RabbitMQ message broker.


Languages

Language:Ruby 78.5%Language:HTML 17.7%Language:JavaScript 2.5%Language:CSS 1.3%