Method ReplyAsync
ReplyAsync(NatsHeaders?, string?, NatsPubOpts?, CancellationToken)
Reply with an empty message.
ValueTask ReplyAsync(NatsHeaders? headers = null, string? replyTo = null, NatsPubOpts? opts = null, CancellationToken cancellationToken = default)
Parameters
headersNatsHeadersOptional message headers.
replyTostringOptional reply-to subject.
optsNatsPubOptsA NatsPubOpts for publishing options.
cancellationTokenCancellationTokenA CancellationToken used to cancel the command.
Returns
ReplyAsync<TReply>(TReply, NatsHeaders?, string?, INatsSerialize<TReply>?, NatsPubOpts?, CancellationToken)
Reply to this message.
ValueTask ReplyAsync<TReply>(TReply data, NatsHeaders? headers = null, string? replyTo = null, INatsSerialize<TReply>? serializer = null, NatsPubOpts? opts = null, CancellationToken cancellationToken = default)
Parameters
dataTReplySerializable data object.
headersNatsHeadersOptional message headers.
replyTostringOptional reply-to subject.
serializerINatsSerialize<TReply>Serializer to use for the message type.
optsNatsPubOptsA NatsPubOpts for publishing options.
cancellationTokenCancellationTokenA CancellationToken used to cancel the command.
Returns
Type Parameters
TReplySpecifies the type of data that may be sent to the NATS Server.
Remarks
Publishes a new message using the reply-to subject from the this message as the destination subject.
If the serializer is not specified, the INatsSerializerRegistry assigned to
the NatsConnection will be used to find a serializer for the type TReply.
You can specify a INatsSerializerRegistry in NatsOpts when creating a
NatsConnection. If not specified, NatsDefaultSerializerRegistry will be used.
ReplyAsync<TReply>(NatsMsg<TReply>, INatsSerialize<TReply>?, NatsPubOpts?, CancellationToken)
Reply to this message.
ValueTask ReplyAsync<TReply>(NatsMsg<TReply> msg, INatsSerialize<TReply>? serializer = null, NatsPubOpts? opts = null, CancellationToken cancellationToken = default)
Parameters
msgNatsMsg<TReply>A NatsMsg<T> representing message details.
serializerINatsSerialize<TReply>Serializer to use for the message type.
optsNatsPubOptsA NatsPubOpts for publishing options.
cancellationTokenCancellationTokenA CancellationToken used to cancel the command.
Returns
Type Parameters
TReplySpecifies the type of data that may be sent to the NATS Server.
Remarks
Publishes a new message using the reply-to subject from the this message as the destination subject.