ClusteredRedisQueue.send() method
Sends a message to one server of the cluster, selected by health-aware round-robin.
Signature:
send(toQueue: string, message: JsonObject, delay?: number, errorHandler?: (err: Error) => void): Promise<string>;
Parameters
|
Parameter |
Type |
Description |
|---|---|---|
|
toQueue |
string |
queue name to which a message should be sent to |
|
message |
message data | |
|
delay |
number |
(Optional) if specified, a message will be handled in the target queue after a specified period of time in milliseconds |
|
errorHandler |
(err: Error) => void |
(Optional) callback called only when an internal error occurs during message send execution |
Returns:
Promise<string>
message identifier
Exceptions
TypeError propagated from the selected server when it is in IMQMode.WORKER-only mode
Remarks
This is the one operation that does not fan out — the message goes to a single server, and not to a stable one.
When the cluster currently has no servers the send is held until the first server becomes ready, and rejects if none appears within 30 seconds (override with the IMQ_SEND_INIT_TIMEOUT environment variable, in milliseconds).
Read this page as plain markdown — no HTML, no navigation. For pasting into an LLM, or for an agent to fetch.