Method ReplyAsync
ReplyAsync(NatsHeaders?, string?, NatsPubOpts?, CancellationToken)
Reply with an empty message.
public ValueTask ReplyAsync(NatsHeaders? headers = null, string? replyTo = null, NatsPubOpts? opts = null, CancellationToken cancellationToken = default)Parameters
- headersNatsHeaders
- Optional message headers. 
- replyTostring
- Optional reply-to subject. 
- optsNatsPubOpts
- A NatsPubOpts for publishing options. 
- cancellationTokenCancellationToken
- A CancellationToken used to cancel the command. 
Returns
ReplyAsync<TReply>(TReply, NatsHeaders?, string?, INatsSerialize<TReply>?, NatsPubOpts?, CancellationToken)
Reply to this message.
public ValueTask ReplyAsync<TReply>(TReply data, NatsHeaders? headers = null, string? replyTo = null, INatsSerialize<TReply>? serializer = null, NatsPubOpts? opts = null, CancellationToken cancellationToken = default)Parameters
- dataTReply
- Serializable data object. 
- headersNatsHeaders
- Optional message headers. 
- replyTostring
- Optional reply-to subject. 
- serializerINatsSerialize<TReply>
- Serializer to use for the message type. 
- optsNatsPubOpts
- A NatsPubOpts for publishing options. 
- cancellationTokenCancellationToken
- A CancellationToken used to cancel the command. 
Returns
Type Parameters
- TReply
- Specifies 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.
public 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. 
- optsNatsPubOpts
- A NatsPubOpts for publishing options. 
- cancellationTokenCancellationToken
- A CancellationToken used to cancel the command. 
Returns
Type Parameters
- TReply
- Specifies 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.