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

Inherited by NATS.Client.JetStream.StreamContext.

Public Member Functions

StreamInfo GetStreamInfo ()
 
StreamInfo GetStreamInfo (StreamInfoOptions options)
 
PurgeResponse Purge ()
 
PurgeResponse Purge (PurgeOptions options)
 
IConsumerContext GetConsumerContext (string consumerName)
 
IConsumerContext CreateOrUpdateConsumer (ConsumerConfiguration config)
 
IOrderedConsumerContext CreateOrderedConsumer (OrderedConsumerConfiguration config)
 
bool DeleteConsumer (string consumerName)
 
ConsumerInfo GetConsumerInfo (string consumerName)
 
IList< string > GetConsumerNames ()
 
IList< ConsumerInfo > GetConsumers ()
 
MessageInfo GetMessage (ulong seq)
 
MessageInfo GetLastMessage (string subject)
 
MessageInfo GetFirstMessage (string subject)
 
MessageInfo GetNextMessage (ulong seq, string subject)
 
bool DeleteMessage (ulong seq)
 
bool DeleteMessage (ulong seq, bool erase)
 

Properties

string StreamName [get]
 

Detailed Description

The Stream Context provide a set of operations for managing the stream and its contents and for managing consumers.

Member Function Documentation

◆ CreateOrderedConsumer()

IOrderedConsumerContext NATS.Client.JetStream.IStreamContext.CreateOrderedConsumer ( OrderedConsumerConfiguration  config)

Management function to creates a consumer on this stream.

Parameters
configthe consumer configuration to use.
Returns
consumer information.

◆ CreateOrUpdateConsumer()

IConsumerContext NATS.Client.JetStream.IStreamContext.CreateOrUpdateConsumer ( ConsumerConfiguration  config)

Create an ordered consumer context for the context's stream.

Parameters
configthe configuration for the ordered consumer
Returns
an instance of IConsumerContext

◆ DeleteConsumer()

bool NATS.Client.JetStream.IStreamContext.DeleteConsumer ( string  consumerName)

Management function to deletes a consumer.

Parameters
consumerNamethe name of the consumer.
Returns
true if the delete succeeded

◆ DeleteMessage() [1/2]

bool NATS.Client.JetStream.IStreamContext.DeleteMessage ( ulong  seq)

Deletes a message, overwriting the message data with garbage This can be considered an expensive (time-consuming) operation, but is more secure.

Parameters
seqthe sequence number of the message
Returns
true if the delete succeeded

◆ DeleteMessage() [2/2]

bool NATS.Client.JetStream.IStreamContext.DeleteMessage ( ulong  seq,
bool  erase 
)

Deletes a message, optionally erasing the content of the message.

Parameters
seqthe sequence number of the message
erasewhether to erase the message (overwriting with garbage) or only mark it as erased.
Returns
true if the delete succeeded

◆ GetConsumerContext()

IConsumerContext NATS.Client.JetStream.IStreamContext.GetConsumerContext ( string  consumerName)

Create a consumer context for on the context's stream and specific named consumer. Verifies that the consumer exists.

Parameters
consumerNamethe name of the consumer
Returns
an instance of IConsumerContext

◆ GetConsumerInfo()

ConsumerInfo NATS.Client.JetStream.IStreamContext.GetConsumerInfo ( string  consumerName)

Gets the info for an existing consumer.

Parameters
consumerNamethe name of the consumer.
Returns
consumer information

◆ GetConsumerNames()

IList< string > NATS.Client.JetStream.IStreamContext.GetConsumerNames ( )

Return a list of consumers by name

Returns
The list of names

◆ GetConsumers()

IList< ConsumerInfo > NATS.Client.JetStream.IStreamContext.GetConsumers ( )

Return a list of ConsumerInfo objects.

Returns
The list of ConsumerInfo

◆ GetFirstMessage()

MessageInfo NATS.Client.JetStream.IStreamContext.GetFirstMessage ( string  subject)

Get MessageInfo for the first message of the subject.

Parameters
subjectthe subject to get the first message for.
Returns
The MessageInfo

◆ GetLastMessage()

MessageInfo NATS.Client.JetStream.IStreamContext.GetLastMessage ( string  subject)

Get MessageInfo for the last message of the subject.

Parameters
subjectthe subject to get the last message for.
Returns
The MessageInfo

◆ GetMessage()

MessageInfo NATS.Client.JetStream.IStreamContext.GetMessage ( ulong  seq)

Get MessageInfo for the message with the exact sequence in the stream.

Parameters
seqthe sequence number of the message
Returns
The MessageInfo

◆ GetNextMessage()

MessageInfo NATS.Client.JetStream.IStreamContext.GetNextMessage ( ulong  seq,
string  subject 
)

Get MessageInfo for the message of the message sequence is equal to or greater the requested sequence for the subject.

Parameters
seqthe first possible sequence number of the message
subjectthe subject to get the next message for.
Returns
The MessageInfo

◆ GetStreamInfo() [1/2]

StreamInfo NATS.Client.JetStream.IStreamContext.GetStreamInfo ( )

Gets information about the stream for this context. Does not retrieve any optional data. See the overloaded version that accepts StreamInfoOptions

Returns
stream information

◆ GetStreamInfo() [2/2]

StreamInfo NATS.Client.JetStream.IStreamContext.GetStreamInfo ( StreamInfoOptions  options)

Gets information about the stream for this context.

Parameters
optionsthe stream info options. If null, request will not return any optional data.
Returns
stream information

◆ Purge() [1/2]

PurgeResponse NATS.Client.JetStream.IStreamContext.Purge ( )

Purge stream messages

Returns
PurgeResponse the purge response

◆ Purge() [2/2]

PurgeResponse NATS.Client.JetStream.IStreamContext.Purge ( PurgeOptions  options)

Purge messages for a specific subject

Parameters
optionsthe purge options
Returns
PurgeResponse the purge response

Property Documentation

◆ StreamName

string NATS.Client.JetStream.IStreamContext.StreamName
get

Gets the stream name that was used to create the context.

Returns
the stream name

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