Table of Contents

Struct NatsJSMsg<T>

Namespace
NATS.Client.JetStream
Assembly
NATS.Client.JetStream.dll

NATS JetStream message with NatsMsg<T> and control messages.

public readonly struct NatsJSMsg<T> : INatsJSMsg<T>, INatsMsg

Type Parameters

T

User message type

Implements
Inherited Members
Extension Methods

Constructors

NatsJSMsg(NatsMsg<T>, INatsJSContext)

Properties

Connection

Get the connection messages were delivered on.

Data

Get deserialized user data.

Error

Any errors (generally serialization errors) encountered while processing the message.

Headers

Headers of the user message if set.

Metadata

Additional metadata about the message.

ReplyTo

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

Size

Get message size in bytes.

Subject

Get subject of the user message.

Methods

AckAsync(AckOpts?, CancellationToken)

Acknowledges the message was completely handled.

AckProgressAsync(AckOpts?, CancellationToken)

Indicates that work is ongoing and the wait period should be extended.

AckTerminateAsync(AckOpts?, CancellationToken)

Instructs the server to stop redelivery of the message without acknowledging it as successfully processed.

EnsureSuccess()

Throws an exception if the message contains any errors (generally serialization errors).

NakAsync(AckOpts?, CancellationToken)

Signals that the message will not be processed now and processing can move onto the next message.

ReplyAsync(NatsHeaders?, string?, NatsPubOpts?, CancellationToken)

Reply with an empty message.