,

What is RabbitMQ?

RabbitMQ is an open-source message broker. In short, it manages our queues (asynchronous operations).

The broker’s server is written in Erlang, while the API for clients is available in many programming languages, e.g. PHP, java, c #, swift and more.

Synchronous and asynchronous operations

Synchronous operations are operations (also known as blocking operations) that stop a thread until it is executed. Simply put, these are real-time operations.

Asynchronous operations mean that the application that uses them only reacts (starts doing something) when it knows that the necessary data has been transferred.

A few examples of situations when it is worth using asynchronicity

  • Diverse traffic on the site
  • Willingness to reduce the resources used by a given functionality
  • When we perform some business logic that can be performed after the user’s request, eg matching proposed advertisements
  • Functionalities that take a long time to perform

Queue handling by RabbitMQ

Producer

A producer is a system that sends a job to Rabbit. The system may produce multiple jobs, or multiple systems may submit jobs to one queuing system.

source: https://czterytygodnie.pl/rabbitmq/wprowadzenie-do-kolejkowania-rabbitmq.html

Exchange

When tasks go to Rabbit, they are assigned to a specific messaging center. The producer assigns jobs to the specified exchange by specifying its name when sending the job.

source: https://czterytygodnie.pl/rabbitmq/wprowadzenie-do-kolejkowania-rabbitmq.html

Binding

Binding is a mechanism for assigning items in the message center to a specific queue. The division into queues is quite important because we will be dealing with generating reports differently than sending a newsletter.

source: https://czterytygodnie.pl/rabbitmq/wprowadzenie-do-kolejkowania-rabbitmq.html

Consumer

The consumer handles tasks from specific queues.

source: https://czterytygodnie.pl/rabbitmq/wprowadzenie-do-kolejkowania-rabbitmq.html

RabbitMQ management

RabbitMQ management is not available by default and to enable access we must run the command:

rabbitmq-plugins enable rabbitmq_management

After unblocking access, we can log in to the panel at: http://localhost:15672

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Are you searching for developers who genuinely care about your business? Do you need expert consultations in WordPress, Vue, Nuxt, or Laravel, top-tier coding, or thorough audits to boost your success? Look no further! We’ve got you covered.

Topics

AJAX Attribute inheritance backup bounce rate code smell Coditive Contact Form cronjobs database formatting rules GIT Git Flow GitHub Flow GitLab Flow JavScript loading speed MAMP message broker nuxt nuxt3 overlays PHP PHP rules plugin Popups Post Draft Preview RabbitMQ schedule Simple Customizations for WooCommerce Simple Floating Contact Form software development ux Vue.js web development WooCommerce WordPress WordPress CLI WordPress Gutenberg Wordpress plugins WordPress updates WP-CLI wp-cron