I want to tell you about rabbitmq and how to fetch data using this tool. Most readers know that DVELP BE side devs worked on Ruby on Rails, but how they can imagine Rails + Rabbit connection?
What’s the first option how we can imagine rails and rabbit connection? Funny one, but let’s move on.
Messaging enables software applications to connect and scale. Applications can connect to each other, as components of a larger application.
You may be thinking of data delivery, non-blocking operations or push notifications. Or you want to use publish / subscribe, asynchronous processing, or work queues. All these are patterns, and they form part of messaging.
RabbitMQ is a messaging broker. It gives your applications a common platform to send and receive messages, and your messages a safe place to live until received.
Ok, let’s check a real situation. We have list of applications which have to work as one system. How to get required data from the other app? A plain http request to a proper endpoint? That’s not the best option when you have to respond 1000s of unique requests per second. The possible way is messaging communication system. There are 2 the most popular ones:
Due to languages support and free price started from $0/month for 1_000_000 messages, we choose to build our communication system based on RabbitMQ.
The basic structure consists of 2 parts: fetcher and listener. Let’s check integration steps:
Now you know how to build your own communication system. Enjoy!