EN
Free assessment

Expertise · RabbitMQ

RabbitMQ Consulting and Asynchronous Messaging

iTask designs and operates messaging with RabbitMQ: exchanges, queues, DLQs, retries with backoff, idempotency and MassTransit in .NET. We use RabbitMQ in 15 systems, including messaging platforms. The design avoids lost and duplicated messages and keeps the queue under control.

RabbitMQ

Typical command line

rabbitmqctl list_queues

When to use it

When RabbitMQ makes sense

  1. Long tasks block the screen or the API
  2. You integrate with slow or unstable partners
  3. Volume spikes exceed what the database can absorb
  4. Messages get lost or duplicated and nobody knows where

Architecture

The architecture we usually apply

Exchanges per domain (topic or direct), one queue per consumer with its own DLQ, immediate and delayed retries, transactional outbox on the producer, idempotent consumers, MassTransit in .NET and monitoring of queue depth and age.

Messaging solves a simple problem: the system that receives an order does not have to wait for the system that processes it. Doing it right takes discipline. We use RabbitMQ in 15 systems, among them messaging platforms, and the rules below come from what broke in production.

Exchange and queue design

Exchanges per domain. One topic exchange per business context, with routing keys such as order.created or sms.sent. Consumers bind by pattern and receive only what matters to them.

One queue per consumer. Each service has its own queue. If two services need the same event, each gets its own copy. Sharing a queue between different consumers causes a fight over messages.

Durable queues and persistent messages. Without them, a broker restart wipes out the work. For replicated durable queues we use quorum queues (mirroring of classic queues was removed in RabbitMQ 4.0).

Prefetch. Prefetch limits how many messages a consumer receives without acknowledging. A low value spreads load more evenly. A high value increases throughput. We tune it per task type.

End-to-end reliability

Publisher confirms. The producer only considers the message sent after the broker confirms.

Transactional outbox. The producer writes the message in the same database transaction and a separate process publishes it. This avoids the classic case: the database wrote, the publish failed and the system is inconsistent.

Manual consumer acknowledgment. The ack happens only after the work finishes. If the consumer dies midway, the message returns to the queue.

Idempotency. Since delivery is at least once, the consumer must tolerate repetition. We store the ID of the processed message or design the operation to be repeatable, such as an upsert by business key.

Retries, DLQ and poison messages

Not every failure deserves the same response.

  • Transient failure (timeout, service down): immediate retry and then delayed retries with exponential backoff. In MassTransit, we configure UseMessageRetry and delayed redelivery.
  • Permanent failure (malformed message, violated rule): repeating does not help. The message goes straight to the DLQ.
  • Poison message: the one that crashes the consumer in a loop. The retry limit takes it out of the main queue.

The DLQ is monitored, has an alert and a reprocessing procedure. A dead-letter queue with no owner becomes a silent trash can. We usually build a simple tool to inspect, fix and republish.

MassTransit in .NET

MassTransit abstracts the broker and delivers typed consumers, filters, retries, an outbox with Entity Framework, sagas for long flows and OpenTelemetry instrumentation. We use sagas for processes such as billing and approval, where state must survive restarts. MassTransit version 9 is commercial and version 8 remains under Apache 2.0; we review the license with you before choosing. More on the technical base in .NET development.

Operations

Metrics that matter. Queue depth, age of the oldest message, inbound and outbound rate, active consumers, unacknowledged messages and DLQ size. The most useful alert is age, because it shows real delay for the user.

Flow control. Memory and disk limits, and a back-pressure policy for producers. A slow consumer must not take the broker down.

Kubernetes. The broker runs in the cluster or as a managed service, depending on the case, and consumers scale with HPA based on queue depth. See Kubernetes experts.

Contract versioning. Messages evolve with optional fields, and an old version coexists with the new one during migration.

Working with a Brazilian team

Our engineers are based in Brazil, in time zones that overlap with the US working day, and we communicate in English.

How we deliver in weeks

  1. Our own boilerplates. A .NET messaging library with outbox, idempotency, retries, DLQ and metrics dashboards ready.
  2. AI agents with senior review. Agents generate consumers, contracts and tests. A senior engineer reviews the design and every change.
  3. The same team from assessment to deploy. The person who analyzes the queues deploys the fix.
  4. Fixed scope after the assessment. The free assessment maps queues, failures and risks, and proposes a plan with a timeline in weeks.

Common mistakes we fix

A queue used as a database. Messages that sit in the queue for days mask a broken consumer. The queue should drain. If it accumulates, the age alert fires and someone investigates.

A consumer with no retry limit. A malformed message becomes an infinite loop and eats CPU. We define the maximum attempts and the final destination.

Giant messages. Carrying files inside the message weighs on the broker. We store the file in object storage and send only the reference.

Assumed ordering. RabbitMQ preserves order per queue with a single consumer, but retries and parallel consumers break it. When order matters, we partition by business key and design the consumer to tolerate out-of-order arrival.

No failure testing. We take down the consumer, the broker and the network in staging to see what happens. Only then does messaging go to production.

Broker security

Users and permissions per service, with access only to the queues and exchanges they need. TLS on connections, virtual hosts per environment and passwords in a vault. Admin console traffic restricted to the internal network. Each service sees only its own part of the messaging.

See how a RabbitMQ worker processes asynchronous tasks in the Regina Festas case. We have also run messaging with RabbitMQ in production for other clients. It is part of the custom software development service. Request the free assessment.

Case studies

In production at our clients

Projects where this technology carries the system.

FAQ

Questions about RabbitMQ

Did not find your question? Write to us.

RabbitMQ or Kafka?

RabbitMQ for task queues, flexible routing and message-by-message acknowledgment. Kafka for event logs with replay and very high volume. Many business systems live well on RabbitMQ alone.

How do you avoid losing messages?

Durable queues, persistent messages, publisher confirms, manual consumer acknowledgment and a transactional outbox on the producer. Without these pieces, a crash at the wrong moment loses data.

What is a DLQ and when do you use one?

It is the dead-letter queue, where messages go after exhausting their retries. It isolates the poison message from the main queue and lets you reprocess after fixing the cause.

How do you avoid processing the same message twice?

At-least-once delivery means duplicates happen. The consumer is idempotent: it stores the ID of processed messages or uses operations that can repeat without effect.

Do you use MassTransit?

Yes, in .NET. It brings consumers, retries, outbox, sagas and observability ready to use, and reduces infrastructure code.

Tell us what you need to build.

Ask for a free assessment and get a clear path for your project, with no commitment.

Free assessment