Sobes.tech
Junior — Middle

Tell us about your proficiency with RabbitMQ and your experience using it in projects.

sobes.tech AI

Answer from AI

I am familiar with RabbitMQ as a message broker that implements the AMQP protocol. In projects, I used it to organize asynchronous message exchange between services, which helped to unload main processes and increase scalability.

My experience includes:

  • Setting up queues, exchanges, and bindings.
  • Sending and receiving messages using the pika library in Python.
  • Handling delivery acknowledgements and retrying message processing.
  • Using different types of exchanges: direct, topic, fanout for various routing scenarios.

An example of a simple sender and receiver in Python with pika:

import pika

# Sender
connection = pika.BlockingConnection(pika.ConnectionParameters('localhost'))
channel = connection.channel()
channel.queue_declare(queue='task_queue', durable=True)
channel.basic_publish(exchange='', routing_key='task_queue', body='Hello RabbitMQ')
connection.close()

# Receiver
connection = pika.BlockingConnection(pika.ConnectionParameters('localhost'))
channel = connection.channel()
channel.queue_declare(queue='task_queue', durable=True)

def callback(ch, method, properties, body):
    print(f"Received message: {body.decode()}")
    ch.basic_ack(delivery_tag=method.delivery_tag)

channel.basic_consume(queue='task_queue', on_message_callback=callback)
channel.start_consuming()

RabbitMQ helped ensure reliable message delivery and scalability of applications.