Product
Introducing SSO
Streamline your login process and enhance security by enabling Single Sign-On (SSO) on the Socket platform, now available for all customers on the Enterprise plan, supporting 20+ identity providers.
@eduzz/rabbit
Advanced tools
Readme
This is an simplified and padronized RabbitMQ Client for NodeJS
Create a connection
import { Connection } from '@eduzz/rabbit';
export const myRabbit = new Connection({
dsn: 'amqp://...',
exchange: 'my-exchange'
});
Send an message to an topic:
import { myRabbit } from './myRabbit';
const payload = {
hello: 'world'
};
myRabbit.topic('some.topic').persistent().send({ payload });
Listen to one or multiple topics:
import { myRabbit } from './myRabbit';
myRabbit
.queue('my.queue')
.topic('some.topic')
.topic('another.topic')
.durable()
.retryTimeout(60000)
.listen(async data => {
console.log(data);
return true;
});
import { Connection } from '@eduzz/rabbit';
const connection = new Connection({
dsn: 'amqp://....',
exchange: 'theExchange',
exchangeType: 'topic',
connectionName: 'my app'
});
// Listening some topic
await connection
.queue('my.queue')
.topic('my.topic')
.durable()
.retryTimeout(60000)
.listen<string>(async msg => {
console.log(msg);
return true;
});
// Publishing message
(async () => {
const publisher = connection.topic('my.topic').persistent();
setInterval(async () => {
const payload = {
number: Math.random() * 1000
};
publisher.send({
payload
});
}, 1000);
})();
// Delaying Messages
connection.delayQueue('my.delay.queue').durable().from('from.topic').to('to.topic').timeout(5000).create();
FAQs
An simplified amqp client with reconnections and fallback
The npm package @eduzz/rabbit receives a total of 283 weekly downloads. As such, @eduzz/rabbit popularity was classified as not popular.
We found that @eduzz/rabbit demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 5 open source maintainers 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.
Product
Streamline your login process and enhance security by enabling Single Sign-On (SSO) on the Socket platform, now available for all customers on the Enterprise plan, supporting 20+ identity providers.
Security News
Tea.xyz, a crypto project aimed at rewarding open source contributions, is once again facing backlash due to an influx of spam packages flooding public package registries.
Security News
As cyber threats become more autonomous, AI-powered defenses are crucial for businesses to stay ahead of attackers who can exploit software vulnerabilities at scale.