JavaScript message queue libraries

Updated Nov 2026

JavaScript message queue libraries connect an application to a message broker or managed queue service. A producer publishes each message to a topic or queue before a consumer reads and acknowledges it on its own schedule. These libraries let backend services and agent workers hand off jobs, events, and device data without waiting on each other.

Popularity

ioredis has the most monthly downloads in this comparison, at 165.9M, a count that covers every Redis operation rather than messaging alone.

LibraryMonthly downloadsStarsLast releaseLicense
ioredis
165.9M
15.4KJul 2026MIT
@aws-sdk/client-sqs
77.0M
3.7KNov 2026Apache-2.0
@google-cloud/pubsub
41.2M
551Nov 2026Apache-2.0
KafkaJS
19.3M
4.0KFeb 2023MIT
amqplib
16.5M
3.8KNov 2026MIT
MQTT.js
14.6M
9.1KOct 2026MIT
@nats-io/transport-node
3.8M
455Nov 2026Apache-2.0
Azure Service Bus
3.6M
2.3KOct 2026MIT
Downloads: npm, last thirty days. Stars and releases: GitHub. Amber: no release in over a year.

Libraries and code examples

Provides a full-featured Redis client for Node.js.

Downloads / mo
165.9M
Stars
15.4K
Last release
6.0.0
License
MIT

Quickstart

From README.md
$ npm install ioredis
import Redis from 'ioredis';

const redis = new Redis('redis://localhost:6379');
await redis.publish('events', 'Hello world!');
redis.disconnect();

ioredis examples

From open-source projects on GitHub

@aws-sdk/client-sqs

Provides the AWS SDK client for Amazon SQS in Node.js, browsers, and React Native.

Downloads / mo
77.0M
Stars
3.7K
Last release
3.1172.0
License
Apache-2.0

Quickstart

From README.md
$ npm install @aws-sdk/client-sqs
import { SQSClient, GetQueueAttributesCommand } from '@aws-sdk/client-sqs';

const client = new SQSClient({ region: process.env.AWS_REGION });
const result = await client.send(new GetQueueAttributesCommand({
  QueueUrl: process.env.SQS_QUEUE_URL,
  AttributeNames: ['ApproximateNumberOfMessages'],
}));

@aws-sdk/client-sqs examples

From open-source projects on GitHub

@google-cloud/pubsub

Provides the Cloud Pub/Sub client library for Node.js.

Downloads / mo
41.2M
Stars
551
Last release
6.4.1
License
Apache-2.0

Quickstart

From Topic.html
$ npm install @google-cloud/pubsub
import { PubSub } from '@google-cloud/pubsub';

const pubsub = new PubSub();
const topic = pubsub.topic(process.env.PUBSUB_TOPIC);
const messageId = await topic.publishMessage({ data: Buffer.from('Hello world!') });
await pubsub.close();

@google-cloud/pubsub examples

From open-source projects on GitHub

Produces and consumes Apache Kafka messages from Node.js applications.

Downloads / mo
19.3M
Stars
4.0K
Last release
2.2.4
License
MIT

Strengths

  • Consumes whole message batches. Use eachBatch to process batches and control offset resolution.
  • Pauses individual topic partitions. Use pause to stop a topic-partition and resume it later.

Limitations

  • Long handlers need heartbeats. Increase sessionTimeout or send heartbeats during slow message processing.
  • Fatal errors stop consumer restarts. Handle non-retriable errors outside restartOnFailure.

Quickstart

From README.md
$ npm install kafkajs
import { Kafka } from 'kafkajs';

const kafka = new Kafka({ clientId: 'example', brokers: ['localhost:9092'] });
const producer = kafka.producer();
await producer.connect();
await producer.send({ topic: 'events', messages: [{ value: 'Hello world!' }] });
await producer.disconnect();

KafkaJS examples

From open-source projects on GitHub

Connects Node.js applications to AMQP brokers using channels, exchanges, and queues.

Downloads / mo
16.5M
Stars
3.8K
Last release
2.4.0
License
MIT

Strengths

  • Offers broker confirmation callbacks. Use ConfirmChannel callbacks to track server confirmations.
  • Recovers connections when enabled. Configure recovery and recreate channels inside its setup callback.

Limitations

  • Publishing needs backpressure handling. Pause writes after false and resume on drain.
  • Supports AMQP 0-9-1 only. Use another client for AMQP 1.0 brokers.

Quickstart

From README.md
$ npm install amqplib
import amqp from 'amqplib';

const connection = await amqp.connect('amqp://localhost');
const channel = await connection.createChannel();
await channel.assertQueue('jobs');
channel.sendToQueue('jobs', Buffer.from('Hello world!'));
await channel.close();
await connection.close();

amqplib examples

From open-source projects on GitHub

Publishes and subscribes to MQTT topics from Node.js and browsers.

Downloads / mo
14.6M
Stars
9.1K
Last release
5.16.1
License
MIT

Strengths

  • Runs in browsers. Use the same MQTT library in Node.js and browser applications.
  • Processes messages with backpressure. Override handleMessage to process messages one at a time.

Limitations

  • Backpressure handlers must call back. Call callback after handling a message to keep the client moving.
  • Refused connections need retry opt-in. Enable reconnectOnConnackError to retry connections the broker actively denies.

Quickstart

From README.md
$ npm install mqtt
import mqtt from 'mqtt';

const client = await mqtt.connectAsync('mqtt://localhost');
await client.publishAsync('events', 'Hello world!');
await client.endAsync();

MQTT.js examples

From open-source projects on GitHub

@nats-io/transport-node

Provides Node.js NATS connections and re-exports the core messaging APIs.

Downloads / mo
3.8M
Stars
455
Last release
3.5.0
License
Apache-2.0

Strengths

  • Distributes messages within queue groups. Use a queue group to distribute messages among subscribers.
  • Drains messages before closing. Drain the connection to finish subscriptions and send outbound messages.

Limitations

  • JetStream needs another package. Install and import the JetStream module for its additional APIs.
  • Callbacks cannot await message handling. Use an async iterator or handle asynchronous work outside the callback.

Quickstart

From runtimes.md
$ npm install @nats-io/transport-node
import { connect } from '@nats-io/transport-node';

const connection = await connect({ servers: 'nats://localhost:4222' });
connection.publish('events', new TextEncoder().encode('Hello world!'));
await connection.drain();

@nats-io/transport-node examples

From open-source projects on GitHub

Azure Service Bus

Provides the Azure Service Bus SDK for JavaScript.

Downloads / mo
3.6M
Stars
2.3K
Last release
7.10.0
License
MIT

Quickstart

From README.md
$ npm install @azure/service-bus
import { ServiceBusClient } from '@azure/service-bus';

const client = new ServiceBusClient(process.env.SERVICE_BUS_CONNECTION_STRING);
const sender = client.createSender(process.env.SERVICE_BUS_QUEUE);
await sender.sendMessages({ body: 'Hello world!' });
await sender.close();
await client.close();

Azure Service Bus examples

From open-source projects on GitHub

FAQ

The broker decides the library. KafkaJS connects to Apache Kafka, amqplib to RabbitMQ and other AMQP brokers, and MQTT.js to MQTT brokers. Managed services have their own SDKs, such as the AWS SDK SQS client and Google Cloud Pub/Sub.

RabbitMQ routes messages through exchanges and queues with per-message acknowledgement, through amqplib in Node.js. Kafka keeps messages in partitioned logs that consumer groups read by offset, through KafkaJS.

ioredis is a Redis client for Node.js with Pub/Sub and Streams commands. Redis Pub/Sub delivers messages without per-message acknowledgement.

KafkaJS is an Apache Kafka client for Node.js with producers, consumers, and consumer groups. Consumers track their progress through committed offsets.

amqplib is a Node.js client for AMQP brokers such as RabbitMQ. It works with channels, exchanges, queues, routing keys, and optional publisher confirms.

For coding agents

Found your message queue library? Help your agent use it.

Connect Exa so your coding agent can find the library’s documentation, check its API, and look up implementations while you build.

Run in your terminal

claude plugin install exa@claude-plugins-official