Cleanly closes the connection to Rabbit and removes all handlers. Request queue is not deleted.
Delete queues only if empty and not used.
Forces deletion (no check on ifEmpty & ifUnused).
Promise that resolves once the connection has been fully closed.
Emit an event to a target. Target can be a service or just a commonly agreed namespace.
Access to the eventEmitter.
Get the default name used for declaring internal listen queues.
Get the last Date object where a message was received. Does not account for internal messages.
Returns a report about the request queue of a target service
name of the service to get the report about
name of the route for which the report needs to be generated.
Get the UUID generated for this instance.
Returns the name of the service (name supplied while instantiating the service).
Getter: options sat while instantiating the service with the corresponding default values.
Ask for the status of a service
the service name for which a status report needs to be generated
Retrieve the URI to which the instance is connected. undefined when not connected yet.
PUB/SUB creates an event listener
The target on which you want to listen by default it's the serviceName but it can be the name of a commonly agreed exchange
The route on which to listen
The callback function that will be called each time a message arrives on that route
resolves when listeners are fully asserted and returns an object which has a "stop" function.
PUB/SUB creates an event listener
The route on which to listen
The callback function that will be called each time a message arrives on that route
resolves when listeners are fully asserted and returns an object which has a "stop" function.
Like task without ack
Raised each time the leader is changing
The process receiving this message was not the master and became master
The process receiving this message was previously the master process and is not enymore
We detected that the event loop or the memory is becoming unresponsive, if QOS is enabled, messages flowing in will be dramatically reduced
The memory or event loop pressure has been released
The connection to rabbit has been closed
Conncetion to rabbit successfully established
Raised when receiving a message for which there is no handler
An error happened
The request or event you sent could not be delivered because the target queue doesn't exists
Get notified of received requests where an answer was expected within a timeout for which no answer was given on time.
Sets a callback for an event. Will be triggered at max 1 time.
RPC implementation. Request a service identified by the name targetService. The promise will resolve when the target replies or that there is an error (timeout, unroutable, etc.) If there are multiple instances of the targetService, only one will handle it. Use timeout: -1 if you don't want the request to timeout.
The name of the service that will have to handle the request
A routing key to the handler in the targetService
The message to send
how long max before giving up on getting an answer to the request
callback that will be called when the reply is a stream
The final response message to the request
Worker queue implementation. By default we always want an acknowledgment to a sent task (for backwards compatibility).
The name of the service that will have to handle the request
A routing key to the handler in the targetService
The message to send.
A promise that resolves once the message has been sent or a proxied request
Generated using TypeDoc