amqplib (Node.js AMQP)

AMQP 0-9-1 client library for Node.js — the standard protocol used by RabbitMQ. amqplib provides both callback and Promise-based APIs (amqplib/channel_api) for connecting to RabbitMQ, declaring exchanges and queues, publishing and consuming messages, and managing acknowledgments. The go-to Node.js library for RabbitMQ integration in agent messaging pipelines.

Evaluated Mar 06, 2026 (0d ago) v0.10+
Homepage ↗ Repo ↗ Developer Tools javascript node rabbitmq amqp messaging queue publish-subscribe open-source
⚙ Agent Friendliness
58
/ 100
Can an agent use this?
🔒 Security
82
/ 100
Is it safe for agents?
⚡ Reliability
79
/ 100
Does it work consistently?

Score Breakdown

⚙ Agent Friendliness

MCP Quality
--
Documentation
80
Error Messages
75
Auth Simplicity
80
Rate Limits
78

🔒 Security

TLS Enforcement
88
Auth Strength
82
Scope Granularity
78
Dep. Hygiene
82
Secret Handling
80

TLS/SSL via amqps://. RabbitMQ VHOST isolation for multi-tenant environments. Credentials in connection URL — use environment variables, not hardcoded strings.

⚡ Reliability

Uptime/SLA
80
Version Stability
82
Breaking Changes
80
Error Recovery
75
AF Security Reliability

Best When

You're integrating Node.js agent services with RabbitMQ for flexible message routing, reliable delivery, and complex exchange/queue topologies.

Avoid When

You don't need RabbitMQ's routing complexity — BullMQ or SQS are simpler for basic job queues. Or if using Kafka for high-throughput streaming.

Use Cases

  • Publish agent task messages to RabbitMQ queues for distributed agent worker consumption with acknowledgment-based delivery
  • Implement topic-based agent event routing with exchange types (direct, topic, fanout, headers) for flexible message distribution
  • Build dead letter queue (DLQ) pipelines for failed agent task handling — messages rejected by agents routed to DLQ for inspection and retry
  • Create durable agent work queues with persistence (durable: true, persistent: true) — messages survive RabbitMQ restarts
  • Use consumer acknowledgments (ack/nack) for at-least-once agent message delivery — prevent message loss on agent crashes

Not For

  • High-throughput streaming scenarios — Kafka is better suited for ordered, replayed, high-throughput event streams
  • Simple job queues without complex routing — BullMQ (Redis-based) is simpler for job queues without RabbitMQ's routing complexity
  • Serverless functions — AMQP connections are long-lived; use SQS or event-driven alternatives for stateless serverless agents

Interface

REST API
No
GraphQL
No
gRPC
No
MCP Server
No
SDK
Yes
Webhooks
No

Authentication

Methods: none
OAuth: No Scopes: No

Library — no external auth. RabbitMQ credentials in AMQP URL (amqp://user:pass@host/vhost). TLS support via amqps:// scheme.

Pricing

Model: open_source
Free tier: Yes
Requires CC: No

MIT-licensed open source. RabbitMQ server itself is also open source (MPL 2.0). CloudAMQP provides managed RabbitMQ with paid plans.

Agent Metadata

Pagination
none
Idempotent
Partial
Retry Guidance
Not documented

Known Gotchas

  • Channel errors close the channel — after a channel error (reject, channel overflow) the channel is unusable; agent code must create a new channel and re-register consumers
  • Connection and channel are separate objects — connection loss closes all channels; implement reconnection with backoff for both connection and all channel/consumer registrations
  • consumer tag must be unique per connection — reusing consumer tags after reconnection causes 'PRECONDITION_FAILED' errors; use unique UUID or let RabbitMQ auto-assign
  • prefetch count (ch.prefetch()) limits unacknowledged messages per consumer — without prefetch, RabbitMQ sends all available messages to one consumer; configure based on agent processing capacity
  • amqplib is not fork-safe — in Node.js cluster mode or worker threads, each process needs its own AMQP connection; shared connections across workers causes channel corruption
  • Message delivery mode 2 (persistent) survives broker restart only if the queue is also durable — declaring a transient queue but sending persistent messages provides false durability

Alternatives

Full Evaluation Report

Detailed scoring breakdown, competitive positioning, security analysis, and improvement recommendations for amqplib (Node.js AMQP).

$99

Scores are editorial opinions as of 2026-03-06.

5215
Packages Evaluated
26151
Need Evaluation
173
Need Re-evaluation
Community Powered