Table of Contents

Constructor NatsMsg

Namespace
NATS.Client.Core
Assembly
NATS.Client.Core.dll

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 string

The destination subject to publish to.

ReplyTo string

The reply subject that subscribers can use to send a response back to the publisher/requester.

Size int

Message size in bytes.

Headers NatsHeaders

Pass additional information using name-value pairs.

Data T

Serializable data object.

Connection INatsConnection

NATS 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;