1

I'm in the process of making a consumer for rabbtMQ. I'm using python and after research i decided to use Kombu. With Kombu I already connected to a queue in rabbit and read the messages. The code is

queue = Queue('someQueue')

def process(body, message):
    # Something
    message.ack()

# connections
with Connection(hostname="localhost", userid="****", password="****", port=****, virtualhost="/") as conn:

# consume
with conn.Consumer(queue, callbacks=[process]) as consumer:
    # Process messages and handle events on all channels
    while True:
        conn.drain_events() 

It seems to work but I often see that Celery and Kombu are used together. I only need to consume the messages from the queue, is Kombu enough or should I integrate Celery as well. If so, does anyone has a good example, I found examples but they aren't clear to me. Also I want to make my queue durable=false but the consumer seems to have durable =true by default. How can I change this?

Thanks for any help!

Gerardo
  • 13
  • 2
  • if you want to create a queue and a consumer for it.No need of celery and kombu. Just RabbitMQ only.Use https://www.rabbitmq.com/tutorials/tutorial-one-python.html (python client) – itzMEonTV Apr 14 '15 at 17:08
  • i see they use pika, can you maybe tell me the benefits of not using kombu? – Gerardo Apr 14 '15 at 19:16
  • The short answer is no, you don't need celery. What are you looking for in an example? You've already posted a simple example that you say works haven't you? What is missing from the example you posted in your question? Also, the durability of the queue is a server property. As a client you cannot control whether the queue is durable or not. – Pace Apr 14 '15 at 19:59
  • I just wanted to make sure there wasn't a useful functionality i was missing. – Gerardo Apr 14 '15 at 21:13

0 Answers0