
Company News
Socket Named Top Sales Organization by RepVue
Socket won two 2026 Reppy Awards from RepVue, ranking in the top 5% of all sales orgs. AE Alexandra Lister shares what it's like to grow a sales career here.
alpha-amqp-consumer
Advanced tools
Library for reliable message consumption via AMQP protocol.
Features:
npm install alpha-amqp-consumer
const connect = require('alpha-amqp-consumer');
connect('amqp://localhost')
.then(manager => {
manager.consume(
(message) => {
// once function execution is done the message will be ACK-ed
},
{queue: 'example-queue'},
);
});
Usage with promises
// (...)
manager.consume(
{queue: 'example-queue'},
() => {
// automatically ACK-ed once promise gets resolved (in that case after 1 second)
return new Promise((resolve) => setTimeout(resolve, 1000));
}
);
// (...)
See special API declaration file and examples directory.
Every consumer has "resultHandler" which a function that decides what to do with the messages based on the result from consumer function. Message is rejected automatically it consumer function throws an error or returned promise gets rejected, otherwise message is ACKed. You can customize the behavior by providing resultHandler
manager.consume((message) => {
// do something
}, {
queue: 'some-queue',
resultHandler(context, error) {
if (error) {
// maybe thrown error is fine?
if (isAcceptableError(error)) {
context.ack();
} else {
context.reject();
}
} else {
context.ack();
}
}
})
There is no way to say AMQP to retry message consumption after certain period of time. In order to achieve that we need a bit more typology setup.
We need:
For more information how retry works another document.
manager.setupDelayedRetryTopology({
exchange: {
pre: 'pre-retry',
post: 'post-retry'
},
queue: 'messages-to-retry'
})
.then(() => {
manager.consume(() => {
// do something with message
}, {
queue: 'some-queue',
resultHandler(context, error) {
if (error) {
context.retry(5000);
} else {
context.ack();
}
}
})
});
Run your app with DEBUG env variable. See debug package docs for more details.
DEBUG=alpha-amqp-consumer:* node app.js
FAQs
Reliable message consumption via AMQP protocol
The npm package alpha-amqp-consumer receives a total of 2 weekly downloads. As such, alpha-amqp-consumer popularity was classified as not popular.
We found that alpha-amqp-consumer demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Company News
Socket won two 2026 Reppy Awards from RepVue, ranking in the top 5% of all sales orgs. AE Alexandra Lister shares what it's like to grow a sales career here.

Security News
NIST will stop enriching most CVEs under a new risk-based model, narrowing the NVD's scope as vulnerability submissions continue to surge.

Company News
/Security News
Socket is an initial recipient of OpenAI's Cybersecurity Grant Program, which commits $10M in API credits to defenders securing open source software.