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 does RabbitMQ actually store the message physically?

RabbitMQ uses a custom DB to store the messages, the db is usually located here: /var/lib/rabbitmq/mnesia/rabbit@hostname/queues Starting form the version 3.5.5 RabbitMQ introduced the new New Credit Flow https://www.rabbitmq.com/blog/2015/10/06/new-credit-flow-settings-on-rabbitmq-3-5-5/ Let’s take a look at how RabbitMQ queues store messages. When a message enters the queue, the queue needs to determine if the message should be … Read more

How to requeue messages in RabbitMQ

Short answer: To requeue specific message you can pick both basic.reject or basic.nack with multiple flag set to false. basic.consume calling may also results to messages redelivering if you are using message acknowledge and there are un-acknowledged message on consumer at specific time and consumer exit without ack-ing them. basic.recover will redeliver all un-acked messages … Read more

Delayed message in RabbitMQ

There are two approaches you can try: Old Approach: Set the TTL(time to live) header in each message/queue(policy) and then introduce a DLQ to handle it. once the ttl expired your messages will move from DLQ to main queue so that your listener can process it. Latest Approach: Recently RabbitMQ came up with RabbitMQ Delayed … Read more

When to use RabbitMQ shovels and when Federation plugin?

Shovels and queue provide different means to be forward messages from one RabbitMQ node to another. Federated Exchange With a federated exchange, queues can be connected to the queue on the upstream(source) node. In addition, an exchange on the downstream(destination) node will receive a copy of messages that are published to the upstream node. Federated … Read more

What does MassTransit add to RabbitMQ?

Things that MT adds on top of just using RabbitMQ: Optimized, asynchronous multithreaded, concurrent consumers Message serialization, with support for interfaces, classes, and records, including guidance on versioning message contracts Automatic exchange bindings, publish conventions Saga state machines, including persistent state via Entity Framework Core, MongoDB, Redis, etc. Built-in metrics, Open Telemetry, Prometheus Message headers … Read more

RabbitMQ/AMQP – Best Practice Queue/Topic Design in a MicroService Architecture [closed]

I generally find it is best to have exchanges grouped by object type / exchange type combinations. in you example of user events, you could do a number of different things depending on what your system needs. in one scenario, it might make sense to have an exchange per event as you’ve listed. you could … Read more

How can I recover unacknowledged AMQP messages from other channels than my connection’s own?

Unacknowledged messages are those which have been delivered across the network to a consumer but have not yet been ack’ed or rejected — but that consumer hasn’t yet closed the channel or connection over which it originally received them. Therefore the broker can’t figure out if the consumer is just taking a long time to … Read more

rabbitmq refusing to start

Rabbitmq is set to start automatically after it’s installed. I don’t think it is configured run with the service command. To see the status of rabbitmq sudo rabbitmqctl status To stop the rabbitmq sudo rabbitmqctl stop (Try the status command again to see that it’s stopped). To start it again, the recommended method is sudo … Read more