NATS .NET Client  1.1.4
The NATS.io .NET C# Client
NATS.Client.JetStream.IJetStream Interface Reference

Inherited by NATS.Client.JetStream.JetStream.

Public Member Functions

PublishAck Publish (string subject, byte[] data)
 
PublishAck Publish (string subject, MsgHeader headers, byte[] data)
 
PublishAck Publish (string subject, byte[] data, PublishOptions publishOptions)
 
PublishAck Publish (string subject, MsgHeader headers, byte[] data, PublishOptions publishOptions)
 
PublishAck Publish (Msg message)
 
PublishAck Publish (Msg message, PublishOptions publishOptions)
 
Task< PublishAck > PublishAsync (string subject, byte[] data)
 
Task< PublishAck > PublishAsync (string subject, MsgHeader headers, byte[] data)
 
Task< PublishAck > PublishAsync (string subject, byte[] data, PublishOptions publishOptions)
 
Task< PublishAck > PublishAsync (string subject, MsgHeader headers, byte[] data, PublishOptions publishOptions)
 
Task< PublishAck > PublishAsync (Msg message)
 
Task< PublishAck > PublishAsync (Msg message, PublishOptions publishOptions)
 
IJetStreamPullSubscription PullSubscribe (string subject, PullSubscribeOptions options)
 
IJetStreamPullAsyncSubscription PullSubscribeAsync (string subject, EventHandler< MsgHandlerEventArgs > handler, PullSubscribeOptions options)
 
IJetStreamPushAsyncSubscription PushSubscribeAsync (string subject, EventHandler< MsgHandlerEventArgs > handler, bool autoAck)
 
IJetStreamPushAsyncSubscription PushSubscribeAsync (string subject, EventHandler< MsgHandlerEventArgs > handler, bool autoAck, PushSubscribeOptions options)
 
IJetStreamPushAsyncSubscription PushSubscribeAsync (string subject, string queue, EventHandler< MsgHandlerEventArgs > handler, bool autoAck)
 
IJetStreamPushAsyncSubscription PushSubscribeAsync (string subject, string queue, EventHandler< MsgHandlerEventArgs > handler, bool autoAck, PushSubscribeOptions options)
 
IJetStreamPushSyncSubscription PushSubscribeSync (string subject)
 
IJetStreamPushSyncSubscription PushSubscribeSync (string subject, PushSubscribeOptions options)
 
IJetStreamPushSyncSubscription PushSubscribeSync (string subject, string queue)
 
IJetStreamPushSyncSubscription PushSubscribeSync (string subject, string queue, PushSubscribeOptions options)
 
IStreamContext GetStreamContext (string streamName)
 
IConsumerContext GetConsumerContext (string streamName, string consumerName)
 

Detailed Description

This is the JetStream context for creation and access to persistent streams and consumers.

A JetStream context is created by the IConnect.JetStreamContext() API.

Member Function Documentation

◆ GetConsumerContext()

IConsumerContext NATS.Client.JetStream.IJetStream.GetConsumerContext ( string  streamName,
string  consumerName 
)

Create a consumer context for a specific named stream and specific named consumer. Verifies that the stream and consumer exist.

Parameters
streamNamethe name of the stream
consumerNamethe name of the consumer
Returns
an IConsumerContext instance

◆ GetStreamContext()

IStreamContext NATS.Client.JetStream.IJetStream.GetStreamContext ( string  streamName)

Create a stream context for a specific named stream. Verifies that the stream exists.

Parameters
streamNamethe name of the stream
Returns
an IStreamContext instance

◆ Publish() [1/6]

PublishAck NATS.Client.JetStream.IJetStream.Publish ( Msg  message)

Send a message and waits for a response from JetStream.

Parameters
messageA Msg that contains the request data to publish to the connected NATS server. Any reply subject will be ignored.
Returns
A publish acknowledgement

◆ Publish() [2/6]

PublishAck NATS.Client.JetStream.IJetStream.Publish ( Msg  message,
PublishOptions  publishOptions 
)

Send a message and waits for a response from JetStream.

Parameters
messageA Msg that contains the request data to publish to the connected NATS server. Any reply subject will be ignored.
publishOptionsOptions for publishing.
Returns
A publish acknowledgement.

◆ Publish() [3/6]

PublishAck NATS.Client.JetStream.IJetStream.Publish ( string  subject,
byte[]  data 
)

Send a message to the specified subject and waits for a response from Jetstream. The message body will not be copied.

The expected usage with string content is something like:

nc = Nats.connect()
IJetStream js = nc.JetStream()
js.Publish("destination", "message".getBytes("UTF-8"), publishOptions)

where the sender creates a byte array immediately before calling publish.

Parameters
subjectThe subject to publish data to over the current connection.
dataAn array of type byte that contains the data to publish to the connected NATS server.
Returns
PublishAck

◆ Publish() [4/6]

PublishAck NATS.Client.JetStream.IJetStream.Publish ( string  subject,
byte[]  data,
PublishOptions  publishOptions 
)

Send a message to the specified subject and waits for a response from Jetstream. The message body will not be copied.

The expected usage with string content is something like:

nc = Nats.connect()
IJetStream js = nc.JetStream
js.Publish("destination", "message".getBytes("UTF-8"), publishOptions)

where the sender creates a byte array immediately before calling publish.

Parameters
subjectThe subject to publish data to over the current connection.
dataAn array of type byte that contains the data to publish to the connected NATS server.
publishOptionsOptions for publishing.
Returns
PublishAck

◆ Publish() [5/6]

PublishAck NATS.Client.JetStream.IJetStream.Publish ( string  subject,
MsgHeader  headers,
byte[]  data 
)

Send a message to the specified subject and waits for a response from Jetstream. The message body will not be copied.

The expected usage with string content is something like:

nc = Nats.connect()
IJetStream js = nc.JetStream()
MsgHeader h = new MsgHeader { { "foo", "bar" } };
js.Publish("destination", h, "message".getBytes("UTF-8"), publishOptions)

where the sender creates a byte array immediately before calling publish.

Parameters
subjectThe subject to publish data to over the current connection.
headersOptional headers to publish with the message.
dataAn array of type byte that contains the data to publish to the connected NATS server.
Returns
PublishAck

◆ Publish() [6/6]

PublishAck NATS.Client.JetStream.IJetStream.Publish ( string  subject,
MsgHeader  headers,
byte[]  data,
PublishOptions  publishOptions 
)

Send a message to the specified subject and waits for a response from Jetstream. The message body will not be copied.

The expected usage with string content is something like:

nc = Nats.connect()
IJetStream js = nc.JetStream
MsgHeader h = new MsgHeader { { "foo", "bar" } };
js.Publish("destination", h, "message".getBytes("UTF-8"), publishOptions)

where the sender creates a byte array immediately before calling publish.

Parameters
subjectThe subject to publish data to over the current connection.
headersOptional headers to publish with the message.
dataAn array of type byte that contains the data to publish to the connected NATS server.
publishOptionsOptions for publishing.
Returns
PublishAck

◆ PublishAsync() [1/6]

Task< PublishAck > NATS.Client.JetStream.IJetStream.PublishAsync ( Msg  message)

FIX Comments for rest of async.

Asynchronously sends a message to JetStream.

Parameters
messageA Msg that contains the request data to publish to the connected NATS server. Any reply subject will be ignored.
Returns
A publish acknowledgement

◆ PublishAsync() [2/6]

Task< PublishAck > NATS.Client.JetStream.IJetStream.PublishAsync ( Msg  message,
PublishOptions  publishOptions 
)

Asynchronously sends a message to JetStream with options.

Parameters
messageA Msg that contains the request data to publish to the connected NATS server. Any reply subject will be ignored.
publishOptionsOptions for publishing.
Returns
A publish acknowledgement.

◆ PublishAsync() [3/6]

Task< PublishAck > NATS.Client.JetStream.IJetStream.PublishAsync ( string  subject,
byte[]  data 
)

Asynchronously sends a message to the specified subject and waits for a response from Jetstream. The message body will not be copied.

The expected usage with string content is something like:

nc = Nats.connect()
IJetStream js = nc.JetStream()
js.Publish("destination", "message".getBytes("UTF-8"), publishOptions)

where the sender creates a byte array immediately before calling publish.

Parameters
subjectThe subject to publish data to over the current connection.
dataAn array of type byte that contains the data to publish to the connected NATS server.
Returns
PublishAck

◆ PublishAsync() [4/6]

Task< PublishAck > NATS.Client.JetStream.IJetStream.PublishAsync ( string  subject,
byte[]  data,
PublishOptions  publishOptions 
)

Asynchronously sends data to the specified subject. The message body will not be copied.

The expected usage with string content is something like:

nc = Nats.connect()
IJetStream js = nc.JetStream
js.Publish("destination", "message".getBytes("UTF-8"), publishOptions)

where the sender creates a byte array immediately before calling publish.

Parameters
subjectThe subject to publish data to over the current connection.
dataAn array of type byte that contains the data to publish to the connected NATS server.
publishOptionsOptions for publishing.
Returns
PublishAck

◆ PublishAsync() [5/6]

Task< PublishAck > NATS.Client.JetStream.IJetStream.PublishAsync ( string  subject,
MsgHeader  headers,
byte[]  data 
)

Asynchronously sends a message to the specified subject and waits for a response from Jetstream. The message body will not be copied.

The expected usage with string content is something like:

nc = Nats.connect()
IJetStream js = nc.JetStream()
MsgHeader h = new MsgHeader { { "foo", "bar" } };
js.Publish("destination", h, "message".getBytes("UTF-8"), publishOptions)

where the sender creates a byte array immediately before calling publish.

Parameters
subjectThe subject to publish data to over the current connection.
headersOptional headers to publish with the message.
dataAn array of type byte that contains the data to publish to the connected NATS server.
Returns
PublishAck

◆ PublishAsync() [6/6]

Task< PublishAck > NATS.Client.JetStream.IJetStream.PublishAsync ( string  subject,
MsgHeader  headers,
byte[]  data,
PublishOptions  publishOptions 
)

Asynchronously sends data to the specified subject. The message body will not be copied.

The expected usage with string content is something like:

nc = Nats.connect()
IJetStream js = nc.JetStream
MsgHeader h = new MsgHeader { { "foo", "bar" } };
js.Publish("destination", h, "message".getBytes("UTF-8"), publishOptions)

where the sender creates a byte array immediately before calling publish.

Parameters
subjectThe subject to publish data to over the current connection.
headersOptional headers to publish with the message.
dataAn array of type byte that contains the data to publish to the connected NATS server.
publishOptionsOptions for publishing.
Returns
PublishAck

◆ PullSubscribe()

IJetStreamPullSubscription NATS.Client.JetStream.IJetStream.PullSubscribe ( string  subject,
PullSubscribeOptions  options 
)

Creates a JetStream pull subscription. Pull subscriptions fetch messages from the server in batches.

Parameters
subjectThe subject on which to listen for messages. The subject can have wildcards (partial: *, full: >).
optionsPull Subscribe options for this subscription.
Returns
An IJetStreamPullSubscription

◆ PullSubscribeAsync()

IJetStreamPullAsyncSubscription NATS.Client.JetStream.IJetStream.PullSubscribeAsync ( string  subject,
EventHandler< MsgHandlerEventArgs handler,
PullSubscribeOptions  options 
)

Creates a JetStream pull subscription with an eventHandler. Pull subscriptions fetch messages from the server in batches.

Parameters
subjectThe subject on which to listen for messages. The subject can have wildcards (partial: *, full: >).
handlerThe EventHandler<MsgHandlerEventArgs> invoked when messages are received on the returned IAsyncSubscription.
optionsPull Subscribe options for this subscription.
Returns
An IJetStreamPullSubscription

◆ PushSubscribeAsync() [1/4]

IJetStreamPushAsyncSubscription NATS.Client.JetStream.IJetStream.PushSubscribeAsync ( string  subject,
EventHandler< MsgHandlerEventArgs handler,
bool  autoAck 
)

Creates a push subscriber on the given subject , and begins delivering messages to the given event handler.

All subscribers with the same queue name will form the queue group and only one member of the group will be selected to receive any given message.

The IJetStreamSubscription returned will start delivering messages to the event handler as soon as they are received.

Parameters
subjectThe subject on which to listen for messages. The subject can have wildcards (partial: *, full: >).
handlerThe EventHandler<MsgHandlerEventArgs> invoked when messages are received on the returned IAsyncSubscription.
autoAckWhether or not to auto ack the message
Returns
An IJetStreamPushAsyncSubscription to use to read any messages received from the NATS Server on the given subject .
See also
ISubscription.Subject
Returns
A JetStream push subscription

◆ PushSubscribeAsync() [2/4]

IJetStreamPushAsyncSubscription NATS.Client.JetStream.IJetStream.PushSubscribeAsync ( string  subject,
EventHandler< MsgHandlerEventArgs handler,
bool  autoAck,
PushSubscribeOptions  options 
)

Creates a push subscriber on the given subject , and begins delivering messages to the given event handler.

All subscribers with the same queue name will form the queue group and only one member of the group will be selected to receive any given message.

The IJetStreamSubscription returned will start delivering messages to the event handler as soon as they are received.

Parameters
subjectThe subject on which to listen for messages. The subject can have wildcards (partial: *, full: >).
handlerThe EventHandler<MsgHandlerEventArgs> invoked when messages are received on the returned IJetStreamPushAsyncSubscription.
autoAckWhether or not to auto ack the message
optionsPull Subscribe options for this subscription.
Returns
An IJetStreamPushAsyncSubscription to use to read any messages received from the NATS Server on the given subject .
See also
ISubscription.Subject

◆ PushSubscribeAsync() [3/4]

IJetStreamPushAsyncSubscription NATS.Client.JetStream.IJetStream.PushSubscribeAsync ( string  subject,
string  queue,
EventHandler< MsgHandlerEventArgs handler,
bool  autoAck 
)

Creates an subscriber on the given subject , and begins delivering messages to the given event handler.

All subscribers with the same queue name will form the queue group and only one member of the group will be selected to receive any given message.

The IJetStreamSubscription returned will start delivering messages to the event handler as soon as they are received.

Parameters
subjectThe subject on which to listen for messages. The subject can have wildcards (partial: *, full: >).
queueThe name of the queue group in which to participate.
handlerThe EventHandler<MsgHandlerEventArgs> invoked when messages are received on the returned IAsyncSubscription.
autoAckWhether or not to auto ack the message
Returns
An IAsyncSubscription to use to read any messages received from the NATS Server on the given subject .
See also
ISubscription.Subject, ISubscription.Queue
Returns
An IJetStreamPushAsyncSubscription

◆ PushSubscribeAsync() [4/4]

IJetStreamPushAsyncSubscription NATS.Client.JetStream.IJetStream.PushSubscribeAsync ( string  subject,
string  queue,
EventHandler< MsgHandlerEventArgs handler,
bool  autoAck,
PushSubscribeOptions  options 
)

Creates an subscriber on the given subject , and begins delivering messages to the given event handler.

All subscribers with the same queue name will form the queue group and only one member of the group will be selected to receive any given message.

The IJetStreamSubscription returned will start delivering messages to the event handler as soon as they are received.

Parameters
subjectThe subject on which to listen for messages. The subject can have wildcards (partial: *, full: >).
queueThe name of the queue group in which to participate.
handlerThe EventHandler<MsgHandlerEventArgs> invoked when messages are received on the returned IAsyncSubscription.
Returns
An IAsyncSubscription to use to read any messages received from the NATS Server on the given subject .
See also
ISubscription.Subject, ISubscription.Queue
Parameters
autoAckWhether or not to auto ack the message
optionsJetStream push subscription options.
Returns
An IJetStreamPushAsyncSubscription

◆ PushSubscribeSync() [1/4]

IJetStreamPushSyncSubscription NATS.Client.JetStream.IJetStream.PushSubscribeSync ( string  subject)

Creates a synchronous JetStream subscriber on the given subject .

Parameters
subjectThe subject on which to listen for messages.
Returns
An IJetStreamPushSyncSubscription to use to read any messages received from the NATS Server on the given subject , as part of the given queue group.
See also
ISubscription.Subject

◆ PushSubscribeSync() [2/4]

IJetStreamPushSyncSubscription NATS.Client.JetStream.IJetStream.PushSubscribeSync ( string  subject,
PushSubscribeOptions  options 
)

Creates a synchronous JetStream subscriber on the given subject .

Parameters
subjectThe subject on which to listen for messages.
optionsJetStream subscription options.
Returns
An IJetStreamPushSyncSubscription to use to read any messages received from the NATS Server on the given subject , as part of the given queue group.
See also
ISubscription.Subject

◆ PushSubscribeSync() [3/4]

IJetStreamPushSyncSubscription NATS.Client.JetStream.IJetStream.PushSubscribeSync ( string  subject,
string  queue 
)

Creates a synchronous JetStream queue subscriber on the given subject .

All subscribers with the same queue name will form the queue group and only one member of the group will be selected to receive any given message synchronously.

Parameters
subjectThe subject on which to listen for messages.
queueThe name of the queue group in which to participate.
Returns
An IJetStreamPushSyncSubscription to use to read any messages received from the NATS Server on the given subject , as part of the given queue group.
See also
ISubscription.Subject, ISubscription.Queue

◆ PushSubscribeSync() [4/4]

IJetStreamPushSyncSubscription NATS.Client.JetStream.IJetStream.PushSubscribeSync ( string  subject,
string  queue,
PushSubscribeOptions  options 
)

Creates a synchronous JetStream queue subscriber on the given subject .

All subscribers with the same queue name will form the queue group and only one member of the group will be selected to receive any given message synchronously.

Parameters
subjectThe subject on which to listen for messages.
queueThe name of the queue group in which to participate.
optionsJetStream subscription options.
Returns
An IJetStreamPushSyncSubscription to use to read any messages received from the NATS Server on the given subject , as part of the given queue group.
See also
ISubscription.Subject, ISubscription.Queue

The documentation for this interface was generated from the following file: