Table of Contents

Class NatsSvcMsgExtensions

Namespace
NATS.Net
Assembly
NATS.Client.Services.dll

Extension helpers for inspecting service responses on the requester side.

public static class NatsSvcMsgExtensions
Inheritance
NatsSvcMsgExtensions
Inherited Members

Remarks

Service handlers signal errors using the Nats-Service-Error and Nats-Service-Error-Code response headers (see ReplyErrorAsync(int, string, NatsHeaders?, string?, NatsPubOpts?, CancellationToken)). These helpers surface that convention on the request side.

Methods

EnsureServiceSuccess<T>(NatsMsg<T>, bool)

Throws NatsSvcEndpointException when the response carries a Nats-Service-Error header.

GetServiceStatus<T>(NatsMsg<T>, bool)

Reads the service status from the response, combining the Nats-Service-Error / Nats-Service-Error-Code headers with the no-responders sentinel.

IsServiceSuccess<T>(NatsMsg<T>, bool)

Returns true when the response does not carry a Nats-Service-Error header.