RabbitMQ C# driver stops receiving messages

EDIT: Since I’m sill getting upvotes on this, I should point out that the .NET RabbitMQ client now has this functionality built in: https://www.rabbitmq.com/dotnet-api-guide.html#connection-recovery Ideally, you should be able to use this and avoid manually implementing reconnection logic. I recently had to implement nearly the same thing. From what I can tell, most of the … Read more

Which form of connection to use with pika

The SelectConnection is useful if your application architecture can benefit from an asynchronous design, e.g. doing something else while the RabbitMQ IO completes (e.g. switch to some other IO etc) . This type of connection uses callbacks to indicate when functions return. For example you can declare callbacks for on_connected, on_channel_open, on_exchange_declared, on_queue_declared etc. …to … Read more

Ack or Nack in rabbitMQ

The basic.nack command is apparently a RabbitMQ extension, which extends the functionality of basic.reject to include a bulk processing mode. Both include a “bit” (i.e. boolean) flag of requeue, so you actually have several choices: nack/reject with requeue=1: the message will be returned to the queue it came from as though it were a new … Read more

How can I check whether a RabbitMQ message queue exists or not?

Don’t bother checking. queue.declare is an idempotent operation. So, if you run it once, twice, N times, the result will still be the same. If you want to ensure that the queue exists, just declare it before using it. Make sure you declare it with the same durability, exclusivity, auto-deleted-ness every time, otherwise you’ll get … Read more

RabbitMQ: How to send Python dictionary between Python producer and consumer?

You can’t send native Python types as your payload, you have to serialize them first. I recommend using JSON: import json channel.basic_publish(exchange=””, routing_key=’task_queue’, body=json.dumps(message), properties=pika.BasicProperties( delivery_mode = 2, # make message persistent )) and def callback(ch, method, properties, body): print(” [x] Received %r” % json.loads(body))

How to configure RabbitMQ connection with spring-rabbit?

The application for that guide is a Spring Boot Application. Add a file application.properties to src/main/resources. You can then configure rabbitmq properties according to the Spring Boot Documentation – scroll down to the rabbitmq properties… … spring.rabbitmq.host=localhost # RabbitMQ host. … spring.rabbitmq.password= # Login to authenticate against the broker. spring.rabbitmq.port=5672 # RabbitMQ port. … spring.rabbitmq.username= … Read more