The connected channel.
The bus connection.
The event emitter that fires events with a message's correlationId when they are received by the channels direct reply-to pseudo-queue.
The key which groups together instances of services. When using the pub-sub pattern only one instance of a service will receive the published message.
The amqp url.
Receives and responds to remote procedure calls.
The default options don't persistently store the messages on the bus and don't guarantee that a service will receive, process or answer the call successfully. Meaning, if a message is received twice, the client must have sent the message twice using call.
Type of the request message
Type of the response message
The queue to read messages from
The callback that gets called every time a new message is received
The options used for receiving messages
Sends remote procedure calls and returns the answer synchronously.
The default options don't persistently store the messages on the bus and don't guarantee that a service will receive, process or answer the call successfully. Check if the call has been processed by checking the return value.
Type of the request message
Type of the response message
The queue to write messages to
The message itself. Will be serialized using stringify.
The options used for sending messages
A promise of the response message
Closes the bus connection and sets channel and connection to undefined
Creates a connection with the bus using the url supplied during initialization.
Gets the current connected channel. If there is none it calls connect to create a channel.
The connected channel
Publishes a message with a routing key.
The default options guarantee that all published messages will be stored on the bus until one instance of each service has processed the message.
Type of the message
The amqp routing key used for the message
The message itself. Will be serialized using stringify.
The options used for sending the message
Stringifies any input using JSON.
The input to stringify
The JSON string
Subscribes to a routing key and calls onMessage on every message.
The default options guarantee that all published messages will be stored persistently on the bus until one instance of each service has processed the message. All instances of the same running service should have the same serviceName, which is supplied during initialization.
Type of a received message
The amqp routing key used for the messages that should be received
The callback that gets called every time a new message is received by this instance. See Error handling for information about acknowledgments and redeliveries.
The options used for receiving messages
Generated using TypeDoc
Creates a new bus client. You can call connect explicitly or call any other method and the connection will be established implicitly.