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
subjectstringThe subject string associated with the message.
replyTostringThe optional reply-to subject string.
headersBufferReadOnlySequence<byte>?The optional buffer containing the message headers.
payloadBufferReadOnlySequence<byte>The buffer containing the message payload.
connectionINatsConnectionThe connection associated with the message.
headerParserNatsHeaderParserThe parser for processing message headers.
serializerINatsDeserialize<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.