Giter VIP home page Giter VIP logo

rxrabbit's Introduction

Download Maven Central

*** DEPRECATED ***

Meltwater replaced its message queueing tech stack in 2020 and are no longer using RabbitMQ. We have therefore decided to stop maintaining this libabry as it is no longer in use internally at Meltwater.

RxRabbit

RxRabbit is a RabbitMQ java 8 client library that extends and enhances the rabbitmq-java-client by providing a resilient, auto-connecting ReactiveX styled API.

Highlights

  • Simple, reactive API based on RxJava that fits the RabbitMQ model.
  • Automatic error handling and recovery that 'just works', both for publishing and consuming.

Getting started

Have a look at the RxRabbit Tutorial to get a feel for how to use the API in a real application.

You can also look at the integration tests and the ExampleCode class.

The javadoc of the core API classes and interfaces is also a good source of reference.

Download dependencies

Gradle:

    compile 'com.meltwater:rxrabbit:$RXRABBIT_VERSION'   

Maven:

    <dependency>
        <groupId>com.meltwater</groupId>
        <artifactId>rxrabbit</artifactId>
        <version>$RXRABBIT_VERSION</version>
        <type>jar</type>
    </dependency>

Design Philosophy

Opinionated API

The API has strong opinions on how RabbitMQ should be used. It hides a lot of functionality from the Channel interface and also introduces a concept of channel types that are made for a specific purpose (such as publish, consume or admin operations). This means of course that there are several things that you can't do with this api, but keep in mind that it is a conscious decision made by the API developers.

Main supported use cases by rxrabbit:

  • Continuously 'infinite' consume (with manual acknowledgment) from an already existing queue on the rabbit broker.
  • Continuously 'infinite' consume (with manual acknowledgment) from a server created, temporary, exclusive queue bound to an existing exchange on the rabbit broker.
  • Publish messages to an exchange with (or without) publisher confirmation but with mandatory=false and immediate=false.
  • Perform basic 'admin' operations (declare, remove and purge queues, exchanges and bindings)

Error handling and recovery

The official rabbitmq Java client provides some basic but non-complete error handling and recovery mechanisms. A number of wrapper libraries already exists today which, with varying success, automatically handles connection recovery in more error scenarios than the official java client. The best ones we have found so far were Spring-amqp which we discovered suffered from excessive and erroneous channel handling, and lyra which, in our view, implements and overly complex error handling logic that still has issues with recovering from some extreme error cases, such as hard broker restarts.

RxRabbit instead uses a very basic but effective approach when it comes to error handling and recovery:

No matter the error, the code assumes that the connection is broken then attempts to re-connect to the broker with exponential back-off

The goal we have is that consumers and producers should not have to care about the underlying rabbit channels and connections. Re-connects should remain hidden from the API user unless specifically asked for (currently achieved by adding listeners).

Building locally

Pre-requisites

Build (including running the tests) by running

./gradlew clean build

Also note that it is currently NOT supported to run the test on OSX using docker machine, you need to be able to connect to docker containers using localhost:.

How to contribute

We happily accept contributions in the form of Github PRs or in the form of bug reports, comments/suggestions or usage questions by creating a github issue.

Notes on project maturity

This library was developed as an Meltwater internal project starting in October 2015. Over the past year it has been battle tested in production by an (ever increasing) majority of our jvm based components and is now an integral part of our technology stack.

License

The MIT License (MIT)

Copyright (c) 2016 Meltwater Inc. http://underthehood.meltwater.com/

rxrabbit's People

Contributors

karlney avatar bergetp avatar volodymyrpavlenko avatar remen avatar

Stargazers

Tim Lee avatar Doğukan Çağatay avatar  avatar Mark Kotyk avatar Michal Fudala avatar  avatar Yesid Bocanegra avatar 诸葛蛋 avatar Zoltan Polgar avatar  avatar Yixing Cheng avatar James Ethridge avatar Vimal avatar  avatar Yury Vashchyla avatar andrii ashomok avatar Marcelo Avancini avatar Jorge avatar Eslam Hamdy avatar Changwoo Park avatar Nazarii avatar Eric Bachhuber avatar Aaron Foltz avatar  avatar Matteo Ferroni avatar Linas N. avatar  avatar Joel C avatar Salimane Adjao Moustapha avatar Alan Kash avatar Jeremiah Hoyet avatar  avatar  avatar

Watchers

Stéphane avatar Aditya Jami avatar  avatar Vincent Demay avatar Ollie Parsley avatar Torsten Landergren avatar Gabor Urbanics avatar Peter Jussi avatar Karl Johansson avatar Joseph Ottinger avatar Nicola Ambrosetti avatar Nicolas Yzet avatar Krishna Koushik avatar Erik Arthur Warendorph avatar Juan Carlos Alonso avatar  avatar Diego avatar James Cloos avatar Monika Schall avatar Ryan Krochko avatar Mateusz Korszun avatar Jim Sheldon avatar Rakib Ansary avatar Ian Muir avatar Anders Rask avatar  avatar Antonio Guillermo avatar Rich Caudle avatar Alex Goodchild avatar  avatar Anton Hägerstrand avatar Eisson avatar aszac avatar  avatar Navid Taheri avatar Bhaskar Chakraborty avatar Eric Hackman avatar Khashayar avatar Tobias Svensson avatar Rasmus Hallinger avatar Diego Romero avatar Sam Ako avatar NadnaN avatar  avatar Stian Grindvoll avatar Fredrik Axelsson avatar Marvin avatar Brian Thompson avatar Benny Tieu avatar Robert Rydefalk avatar Xiaonan Guo avatar Stefano Ortona avatar Florian Arend avatar rubin.apore avatar Drew Mulock avatar Cenk Akin avatar  avatar Animesh Maheshwari avatar Kyle avatar Joan Freed avatar Bastien Semene avatar  avatar  avatar Fernando Ruaro avatar Eniko Dorogi avatar Jennifer Parker avatar Alexandra Stockman avatar  avatar Tom Liu avatar Gavin Ryan avatar Tristan Hohne avatar Yash Sharma avatar  avatar Malena Brinkheden avatar  avatar Cody Perry avatar Nitesh Gupta avatar Nosherwan Adil avatar Sreejith Kenchath avatar Tom Nagelkerke avatar  avatar  avatar Pierre Cabrit avatar  avatar Jared Farago avatar Chelsey Krol avatar Joe Nagel avatar David Shrive avatar Burak Fahri Cabuk avatar Ravi Vijaykumar avatar Salla avatar Bela Toth avatar Danny Suarez avatar Zsuzsanna Took avatar Marlon Taylor avatar Gary Goodger avatar Henning Hoffmann avatar Sumit Sharma avatar Pankaj Sharma avatar  avatar

rxrabbit's Issues

Mirror to Maven Central

Hi,

Thanks for the great library.
Would it be possible to mirror it to Maven Central as well?
It would be much more accessible for Maven users.

RxJava 2 Support

Are there any plans to upgrade to RxJava 2?

If I wanted to upgrade to project to RxJava 2 are you open to a pull request, or is it better to create a separate fork?

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.