GithubHelp home page GithubHelp logo

jollopre / harmoniser Goto Github PK

View Code? Open in Web Editor NEW
6.0 6.0 0.0 107 KB

A minimalistic approach to interact with RabbitMQ

License: MIT License

Dockerfile 0.49% Ruby 98.15% Makefile 1.14% Shell 0.22%
bunny pubsub rabbitmq ruby ruby-gem ruby-on-rails

harmoniser's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

harmoniser's Issues

Introduce Telemetry signals for publish/consume

The Open Telemetry initiative has defined a set of semantic conventions to address messaging operations.

We would like to provide all the minimum and necessary data for publish/consume through harmoniser thats permits an easy collection of telemetry data through external agents such as Honeycomb, NR or the like.

Create functionality for subscribing to queues

  • Manage channel creation efficiently
  • Ensure consumer creation is thread-safe
  • Start consuming once on_delivery method is defined
  • Offer possibility for receiving on_cancellation from rabbitMQ
  • Handle errors as transparent as possible
  • Trap OS signals smooth

Update dependencies for development/release

  • Update Dockerfile to its latest ruby
  • Update RabbitMQ docker to its latest
  • Update bunny gem dependency to its latest
  • Update Gemfile.lock to ensure reproducible development builds

Introduce configuration for RabbitMQ topology

We'd like to introduce the concept of Topology into harmoniser, so that we can explicitly configure:

  • exchanges
  • queues
  • bindings

This should simplify the building of Publisher/Consumer since it will be assumed that exchanges/queues/bindings are already defined.

Dedicate a channel for each publisher/subscriber class

We'd like to have a dedicated channel for each publisher/subscriber class. Some of the reason described below:

  • Isolation: Issues in one channel such as high message processing time will not affect the rest of subscribing cases.
  • Fine-Grained control: Channel specific settings such as prefetch, acknowledgments can be configured differently for each case
  • Resource utilisation: For subscribing cases, we can tune the concurrency per queue thanks to the ConsumerWorkPool increasing or decreasing the throughput on demand

Exit ruby process only when harmoniser is the main process

The existing signal handler only takes place when harmoniser is the main process, however, during the process of reading the require file, a Harmoniser.connection could happen. If there are errors trying to connect, the connection is attempted forever unless a SignalException is received, see here.

This code could become problematic when the exit is instructed if:

  • harmoniser is not the main process, i.e. bundle exec harmoniser was not launched and
  • the process where harmoniser run does not define Signal.trap beforehand.

In order to prevent this scenario, we'd like to make sure that ONLY exit is instructed when harmoniser is the main process, otherwise and under the event of capturing SignalException, we are going to raise it again.

Create functionality for publishing into exchanges

We would like to introduce a functionality that allows publishing messages into RabbitMQ exchanges. This functionality should:

  • permit easy set up with sensible defaults
  • flexibility for setting up advance configuration for exchanges
  • manage channel creation efficiently
  • handle errors as transparent as possible
  • handle OS signals smooth
  • ensure that publishing runs on a thread-safe environment

Configure rabbitmq for publishing/subscribing

Our first approach to perform data sync with publisher/subscribers passes by using a message broker, concretely rabbitmq. We would like to have things in place such as:

  • development/test environment with rabbitmq
  • Configuration object accepting properties to establish connection through Bunny
  • Adequate handing/memoization of Bunny session taking into account network failures and abrupt rabbitmq server disconnection

Add Sensible defaults for Bunny connection

We'd like to offer default options for:

  • timeouts
  • recovery_attempt_started
  • recovery_completed

Also, make sure that connection is close regardless whether or not Harmoniser is used as a Ruby separated process or not.

Update the README

We'd like to update the README to explain:

  • what's this gem
  • how to use it
  • explain the different concepts

Control lifecycle of connection to Bunny

Instead of passing a Bunny instance, we prefer to pass a hash of options, that map with the options available to instantiate Bunny::Session class. This will allow us to better control the following:

  • Create a unique Bunny::Session shared across Harmoniser module
  • Ensure the creation is thread-safe
  • Prevent leaking Bunny::Session across the library through the delegation of specific methods like (create_channel or start)

Introduce retry pattern for establishing connection to RabbitMQ

The existing connection to RabbitMQ performed here does not have retry in place for when the server is not available.
Although an established connection is properly handling re-connection, it is true that under failure for connection, the process can be break.

We would like to introduce a retry strategy for connection establishment so that harmoniser can have:

  • Improved resilience: For instance, intermitent network failures while trying to connect
  • Enhanced availability: Permitting the process to continue as well as reducing its chances of terminated harmoniser process with non zero exit code

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.