Table of Contents

Method Build

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

Build(string, string?, in ReadOnlySequence<byte>?, in ReadOnlySequence<byte>, INatsConnection?, NatsHeaderParser, INatsDeserialize<T>)

Builds a new instance of a NatsMsg<T> with the specified parameters.

public static NatsMsg<T> Build(string subject, string? replyTo, in ReadOnlySequence<byte>? headersBuffer, in ReadOnlySequence<byte> payloadBuffer, INatsConnection? connection, NatsHeaderParser headerParser, INatsDeserialize<T> serializer)

Parameters

subject string

The subject string associated with the message.

replyTo string

The optional reply-to subject string.

headersBuffer ReadOnlySequence<byte>?

The optional buffer containing the message headers.

payloadBuffer ReadOnlySequence<byte>

The buffer containing the message payload.

connection INatsConnection

The connection associated with the message.

headerParser NatsHeaderParser

The parser for processing message headers.

serializer INatsDeserialize<T>

The deserializer for the message payload.

Returns

NatsMsg<T>

A new NatsMsg<T> instance containing the provided data.

Remarks

(INTERNAL API) This method is intended for internal use only. it doesn't have the same guarantees as the public API. it may change in future versions with no notice.

Exceptions

NatsException

Thrown if there is an error during the processing of the message.