Acknowledges the receipt of a message from the server This should only be called on messages that have successfully processed or that you want to remove from the queue so that it is not retried again
Protected
buildCancels the specified consumer
Closes the connection to the server
Connects to the RabbitMQ server
Creates a new message queue on the server
Deletes a message queue from the server
No-Acknowledges the receipt of a message from the server his should only be called on messages that have not successfully processed or that you do not want to remove from the queue so that it is attempted again
Adds the listener
function to the end of the listeners array for the event
named eventName
. No checks are made to see if the listener
has already
been added. Multiple calls passing the same combination of eventName
and
listener
will result in the listener
being added, and called, multiple times.
server.on('connection', (stream) => {
console.log('someone connected!');
});
Returns a reference to the EventEmitter
, so that calls can be chained.
By default, event listeners are invoked in the order they are added. The emitter.prependListener()
method can be used as an alternative to add the
event listener to the beginning of the listeners array.
import { EventEmitter } from 'node:events';
const myEE = new EventEmitter();
myEE.on('foo', () => console.log('a'));
myEE.prependListener('foo', () => console.log('b'));
myEE.emit('foo');
// Prints:
// b
// a
The callback function
Sets our RabbitMQ channel to prefetch such that it limits how many unacknowledged messages we can hold in our specific RabbitMQ channel
Registers a consumer of messages on the channel for the specified queue
Optional
prefetch: numberReplies to the given message with the response payload specified
if true, we will not automatically reply to the message with ack/nack
by default, we requeue the message we are replying to, if we do not want to requeue, set to false
Sends a message to the specified queue requesting that we receipt a reply from the worker that handles the message. This method will wait for the worker to complete the request and the reply is received before the promise will resolve
the amount of time (ms) that we are willing to wait for a reply. If timeout is 0, will wait indefinitely
whether we should use a one-time use queue to receive the reply (this may be necessary in some use cases)
Sends a payload to the specified queue for processing by a consumer
Optional
options: PublishProtected
uuidProtected
Creates a new formatted UUID
Creates a new instance of the RabbitMQ helper