All Projects → dashbitco → broadway_bike_sharing_rabbitmq_example

dashbitco / broadway_bike_sharing_rabbitmq_example

Licence: other
An example of a Broadway pipeline for a bike sharing app with RabbitMQ and PostgreSQL

Programming Languages

elixir
2628 projects
Dockerfile
14818 projects

Projects that are alternatives of or similar to broadway bike sharing rabbitmq example

Tesseract
A set of libraries for rapidly developing Pipeline driven micro/macroservices.
Stars: ✭ 20 (-25.93%)
Mutual labels:  rabbitmq, examples
design-patterns-in-java
☕ 📖 使用通俗易懂的案例,类图,及配套学习笔记来详解 Java 的二十三种设计模式 !
Stars: ✭ 35 (+29.63%)
Mutual labels:  examples
sample-message-driven-microservices
sample spring cloud application that integrates with rabbitmq through spring cloud stream framework as shows how to setup message-driven microservices basing on publish-subscribe model, consumer groups
Stars: ✭ 28 (+3.7%)
Mutual labels:  rabbitmq
gome
gome- Golang Match Engine, uses Golang for calculations, gRPC for services, ProtoBuf for data exchange, RabbitMQ for queues, and Redis for cache implementation of high-performance matching engine microservices/ gome-高性能撮合引擎微服务
Stars: ✭ 47 (+74.07%)
Mutual labels:  rabbitmq
nativescript-vue-examples
🍈 NativeScript and Vue code samples.
Stars: ✭ 13 (-51.85%)
Mutual labels:  examples
fluent-plugin-rabbitmq
Fluent input/output plugin for RabbitMQ.
Stars: ✭ 26 (-3.7%)
Mutual labels:  rabbitmq
VoiceBridge
VoiceBridge - an AI-TOOLKIT Open Source C++ Speech Recognition Toolkit
Stars: ✭ 17 (-37.04%)
Mutual labels:  examples
broadway dashboard
Keep track of your Broadway pipelines from Phoenix LiveDashboard
Stars: ✭ 153 (+466.67%)
Mutual labels:  broadway
leek
Celery Tasks Monitoring Tool
Stars: ✭ 77 (+185.19%)
Mutual labels:  rabbitmq
event-driven-example
An example Event-Driven application in Go built with Watermill library.
Stars: ✭ 81 (+200%)
Mutual labels:  rabbitmq
rejected
rejected is a consumer framework for RabbitMQ
Stars: ✭ 56 (+107.41%)
Mutual labels:  rabbitmq
python-asynchronous-tasks
😎Asynchronous tasks in Python with Celery + RabbitMQ + Redis
Stars: ✭ 37 (+37.04%)
Mutual labels:  rabbitmq
GroupDocs.Classification-for-.NET
GroupDocs.Classification-for-.NET samples and showcase (text and documents classification and sentiment analysis)
Stars: ✭ 38 (+40.74%)
Mutual labels:  examples
Rabbit-OJ-Backend
Using Go & MySQL & Docker & Web Socket & gRPC & Kafka & Zookeeper & Protobuf. Distributed and Scalable Open Judge System for Algorithms.
Stars: ✭ 20 (-25.93%)
Mutual labels:  rabbitmq
tibbar
🐇 Minimalist microservice framework for node and RabbitMQ.
Stars: ✭ 12 (-55.56%)
Mutual labels:  rabbitmq
your-connection-deserves-a-name
Examples and code to assign a name to your MongoDB, MySQL, NATS, Oracle, PostgreSQL, RabbitMQ, and redis connection.
Stars: ✭ 26 (-3.7%)
Mutual labels:  rabbitmq
twitter-go
A high throughput, horizontally scalable microservice backend using Go, Cassandra, RabbitMQ, Kubernetes, Helm.
Stars: ✭ 39 (+44.44%)
Mutual labels:  rabbitmq
robert
基于SpringCloud的企业级微服务多租户系统、多语言的脚手架, 代码组件化、高内聚低耦合,代码简介,注释丰富容易上手,该项目包括用于开发分布式应用程序服务的必要组件,支持多应用程序访问,并使开发人员可以轻松地使用Spring Cloud编程模型来开发分布式应用程序服务。
Stars: ✭ 45 (+66.67%)
Mutual labels:  rabbitmq
mindpatterns
HTML Accessibility Pattern Examples
Stars: ✭ 78 (+188.89%)
Mutual labels:  examples
roger-rabbit
A module that makes the process of consuming and publishing messages in message brokers easier
Stars: ✭ 12 (-55.56%)
Mutual labels:  rabbitmq

BikeSharing

This is an example of a Broadway application using RabbitMQ.

The idea is to simulate a bike sharing application that receives coordinates of bikes in a city and saves those coordinates through a Broadway pipeline.

Steps to reproduce

We first need to get a RabbitMQ instance running and with a valid queue created.

Using Docker, you can run the server by executing:

docker run -it --rm --name rabbitmq -p 5672:5672 -p 15672:15672 rabbitmq:3-management

This command will start the server and will block your terminal, so we need to open another tab to created the queue. To do that we will enter in the container that is running:

docker exec -it rabbitmq /bin/bash

And then, we create our queue:

rabbitmqadmin declare queue name=bikes_queue durable=true

You can see that the queue "bikes_queue" was created by running rabbitmqctl list_queues in the same window.

For this example you need the "postgis" extention for PostgreSQL.

Running the app

After creating the queue, with RabbitMQ server running, you can execute the app in another window with iex -S mix. It will be waiting for events.

To simulate events, first open a connection and then fire some messages:

{:ok, connection} = AMQP.Connection.open
{:ok, channel} = AMQP.Channel.open(connection)
AMQP.Queue.declare(channel, "bikes_queue", durable: true)

Enum.each(1..5000, fn i ->
  AMQP.Basic.publish(channel, "", "bikes_queue", "message #{i}")
end)

AMQP.Connection.close(connection)

You can test with a sample set of data by running the script "priv/publish_sample_events.exs":

mix run --no-halt priv/publish_sample_events.exs

Running with Docker Compose

If you don't want to install PostgreSQL or you don't want to run RabbitMQ by hand, you can try to run this project using Docker compose.

First create the database:

docker-compose run app mix setup

An then run the application:

docker-compose up

It will take a while in the first time. You need to run docker-compose build everytime you change a file in the project.

Conclusion

You can play with the options and the pipeline by editing the lib/bike_sharing.ex file. In the real world we need to analyse and tweak Broadway options for maximum performance.

That is it! You can find more details and configuration at Broadway RabbitMQ documentation and Broadway RabbitMQ Guide. Happy hacking!

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].