Method Build
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
stringThe subject string associated with the message.
replyTo
stringThe 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
INatsConnectionThe connection associated with the message.
headerParser
NatsHeaderParserThe 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.