Constructor NatsMsg
NatsMsg(string, string?, int, NatsHeaders?, T?, INatsConnection?)
NATS message structure as defined by the protocol.
public NatsMsg(string Subject, string? ReplyTo, int Size, NatsHeaders? Headers, T? Data, INatsConnection? Connection)
Parameters
Subject
stringThe destination subject to publish to.
ReplyTo
stringThe reply subject that subscribers can use to send a response back to the publisher/requester.
Size
intMessage size in bytes.
Headers
NatsHeadersPass additional information using name-value pairs.
Data
TSerializable data object.
Connection
INatsConnectionNATS connection this message is associated to.
Remarks
Connection property is used to provide reply functionality.
Message size is calculated using the same method NATS server uses:
int size = subject.Length + replyTo.Length + headers.Length + payload.Length;