Home > @imqueue/rpc > IMessageQueue > send

IMessageQueue.send() method

Sends a message to the specified queue with the given data.

Signature:

send(toQueue: string, message: JsonObject, delay?: number, errorHandler?: (err: Error) => void): Promise<string>;

Parameters

Parameter

Type

Description

toQueue

string

name of the destination queue

message

JsonObject

message data to send

delay

number

(Optional) if specified, the message will be handled in the target queue after the specified delay in milliseconds

errorHandler

(err: Error) => void

(Optional) callback invoked only when an internal error occurs during message send execution

Returns:

Promise<string>

{Promise} - the message identifier