The message's data (or payload)
OptionalheadersPossible headers that may have been set by the server or the publisher.
OptionalreplyA possible subject where the recipient may publish a reply (in the cases where the message represents a request).
The subscription ID where the message was dispatched.
The subject the message was sent to
Convenience to publish a response to the reply subject in the
message - this is the same as doing nc.publish(msg.reply, ...).
Optionalpayload: PayloadOptionalopts: PublishOptionsConvenience to publish a request to the reply subject in the message, resolving with the first response to it. Rejects if the message has no reply subject.
The reply subject (typically the requester's inbox) must be handled by
a subscriber that expects a request there, and responds to it. A
requester using a plain request() won't: its reply is the response,
and nothing answers the follow up, so this times out or rejects with no
responders.
This is useful when implementing custom protocols over NATS, where the response shares an inbox where the client can send additional message(s).
Optionalpayload: PayloadOptionalopts: Partial<Omit<RequestOptions, "noMux" | "reply">>
timeout defaults to 2000 millis
Convenience method to parse the message payload as string. This method may throw an exception if there's a conversion error
Represents a message delivered by NATS. This interface is used by Subscribers.