All Projects → nidhaloff → b-rabbit

nidhaloff / b-rabbit

Licence: MIT license
A thread safe library that aims to provide a simple API for interfacing with RabbitMQ. Built on top of rabbitpy, the library make it very easy to use the RabbitMQ message broker with just few lines of code. It implements all messaging pattern used by message brokers

Programming Languages

python
139335 projects - #7 most used programming language
Makefile
30231 projects

Projects that are alternatives of or similar to b-rabbit

Awesome System Design
A curated list of awesome System Design (A.K.A. Distributed Systems) resources.
Stars: ✭ 4,999 (+33226.67%)
Mutual labels:  distributed-systems, microservices-architecture, message-broker
Advanced Java
😮 Core Interview Questions & Answers For Experienced Java(Backend) Developers | 互联网 Java 工程师进阶知识完全扫盲:涵盖高并发、分布式、高可用、微服务、海量数据处理等领域知识
Stars: ✭ 59,142 (+394180%)
Mutual labels:  distributed-systems, microservices-architecture
Awesome Parallel Computing
A curated list of awesome parallel computing resources
Stars: ✭ 212 (+1313.33%)
Mutual labels:  distributed-systems, parallel-computing
sample-spring-cloud-stream
sample microservices communicating asynchronously using spring cloud stream, rabbitmq
Stars: ✭ 22 (+46.67%)
Mutual labels:  rabbitmq, message-broker
Bigmachine
Bigmachine is a library for self-managing serverless computing in Go
Stars: ✭ 167 (+1013.33%)
Mutual labels:  distributed-systems, parallel-computing
Dkeras
Distributed Keras Engine, Make Keras faster with only one line of code.
Stars: ✭ 181 (+1106.67%)
Mutual labels:  distributed-systems, parallel-computing
go-distsys
Distributed Systems programming examples in the Go programming language.
Stars: ✭ 101 (+573.33%)
Mutual labels:  distributed-systems, microservices-architecture
Dotnet Istanbul Microservices Demo
This is the demo application that i created for my talk 'Microservice Architecture & Implementation with Asp.Net Core' at Dotnet İstanbul Meetup Group.
Stars: ✭ 109 (+626.67%)
Mutual labels:  distributed-systems, rabbitmq
Draco
DRACO: Byzantine-resilient Distributed Training via Redundant Gradients
Stars: ✭ 21 (+40%)
Mutual labels:  distributed-systems, parallel-computing
java-multithread
Códigos feitos para o curso de Multithreading com Java, no canal RinaldoDev do YouTube.
Stars: ✭ 24 (+60%)
Mutual labels:  parallel-computing, multithreading
postman
Reverse proxy for async microservice communication
Stars: ✭ 30 (+100%)
Mutual labels:  rabbitmq, microservices-architecture
Jlitespider
A lite distributed Java spider framework :-)
Stars: ✭ 151 (+906.67%)
Mutual labels:  distributed-systems, rabbitmq
Temporal
Temporal service
Stars: ✭ 3,212 (+21313.33%)
Mutual labels:  distributed-systems, microservices-architecture
Scs
Self-Contained Systems
Stars: ✭ 189 (+1160%)
Mutual labels:  distributed-systems, microservices-architecture
Dtcraft
A High-performance Cluster Computing Engine
Stars: ✭ 122 (+713.33%)
Mutual labels:  distributed-systems, parallel-computing
ParallelQSlim
Shape Aware Parallel Mesh Simplification Algorithm
Stars: ✭ 84 (+460%)
Mutual labels:  parallel-computing, multithreading
alicemq
RabbitMQ Visualizer
Stars: ✭ 102 (+580%)
Mutual labels:  rabbitmq, message-broker
Nats Server
High-Performance server for NATS.io, the cloud and edge native messaging system.
Stars: ✭ 10,223 (+68053.33%)
Mutual labels:  distributed-systems, microservices-architecture
Parapet
A purely functional library to build distributed and event-driven systems
Stars: ✭ 106 (+606.67%)
Mutual labels:  distributed-systems, parallel-computing
roger-rabbit
A module that makes the process of consuming and publishing messages in message brokers easier
Stars: ✭ 12 (-20%)
Mutual labels:  rabbitmq, message-broker

b-rabbit

b-rabbit-icon

https://readthedocs.org/projects/b-rabbit/badge/?version=latest PyPI - Python Version PyPI - Wheel https://pepy.tech/badge/b-rabbit Twitter URL

RabbitMQ without headache.

b-rabbit is a RabbitMq client library that aims to make interfacing with RabbitMQ easier. It is very useful especially inside large projects, in which many boilerplate code must be written.

I started this project when I was working on a large microservices-based project in a large team. I decided to open-source the project afterwards.

Features

  • it implements all RabbitMQ messaging patterns.
  • provides an easy high level API (take a look at the examples)
  • thread safe

When you should use it

  • if you are having problems with other non thread safe libraries (like I did)
  • if you want to develop fast by using a high level API
  • if you don't want to write much code and save much time
  • if you want to use multithreading

Quick Usage

import the library:

from b_rabbit import BRabbit

create a parent instance which provide a global rabbitMQ connection

rabbit = BRabbit(host='localhost', port=5672)

now, just one liner to publish a message:

publisher = rabbit.EventPublisher(b_rabbit=rabbit,
                                  publisher_name='pub').publish(routing_key='testing.test',
                                                                payload='Hello from publisher')

or if you want to subscribe and listen to a certain topic:

 def callback(msg):
    # do something with the received msg from the publisher
    print(f"msg received: {msg}")

# subscribe and run a listener in a thread

subscriber = rabbit.EventSubscriber(
                                b_rabbit=rabbit,
                                routing_key='testing.test',
                                publisher_name='pub',
                                event_listener=callback).subscribe_on_thread()

Advanced Usage using RPC

  • task requester
from b_rabbit import BRabbit


def taskResponseListener(body):
    print('Task Response received')
    print(str(body))


rabbit = BRabbit(host='localhost', port=5672)
taskRequesterSynchron = rabbit.TaskRequesterSynchron(b_rabbit=rabbit,
                                                     executor_name='test',
                                                     routing_key='testing.test',
                                                     response_listener=taskResponseListener)

taskRequesterSynchron.request_task('msg from requester')
rabbit.close_connection()
  • task responser (server)
from b_rabbit import BRabbit
import time

rabbit = BRabbit(host='localhost', port=5672)


def taskListener(server, body):
    print('Task Request received')
    print(str(body))
    time.sleep(5)
    server.send_return(payload="return this value to requester")


taskExecuter = rabbit.TaskExecutor(b_rabbit=rabbit,
                                   executor_name='test',
                                   routing_key='testing.test',
                                   task_listener=taskListener).run_task_on_thread()

Further

Take a look in the examples folder for more. b_rabbit implements also the remote procedure call (RPC) pattern

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].