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

Inherited by NATS.Client.JetStream.JetStreamManagement.

Public Member Functions

AccountStatistics GetAccountStatistics ()
 
StreamInfo AddStream (StreamConfiguration config)
 
StreamInfo UpdateStream (StreamConfiguration config)
 
bool DeleteStream (string streamName)
 
StreamInfo GetStreamInfo (string streamName)
 
StreamInfo GetStreamInfo (string streamName, StreamInfoOptions options)
 
PurgeResponse PurgeStream (string streamName)
 
PurgeResponse PurgeStream (string streamName, PurgeOptions options)
 
ConsumerInfo AddOrUpdateConsumer (string streamName, ConsumerConfiguration config)
 
bool DeleteConsumer (string streamName, string consumer)
 
ConsumerPauseResponse PauseConsumer (string streamName, string consumer, DateTime pauseUntil)
 
bool ResumeConsumer (string streamName, string consumer)
 
ConsumerInfo GetConsumerInfo (string streamName, string consumer)
 
IList< string > GetConsumerNames (string streamName)
 
IList< ConsumerInfo > GetConsumers (string streamName)
 
IList< string > GetStreamNames ()
 
IList< string > GetStreamNames (string subjectFilter)
 
IList< StreamInfo > GetStreams ()
 
IList< StreamInfo > GetStreams (string subjectFilter)
 
MessageInfo GetMessage (string streamName, ulong sequence)
 
MessageInfo GetLastMessage (string streamName, string subject)
 
MessageInfo GetFirstMessage (string streamName, string subject)
 
MessageInfo GetNextMessage (string streamName, ulong sequence, string subject)
 
bool DeleteMessage (string streamName, ulong sequence)
 
bool DeleteMessage (string streamName, ulong sequence, bool erase)
 
IJetStream GetJetStreamContext ()
 

Detailed Description

This is the JetStream management API to programatically create, delete, and update various JetStream objects.

Member Function Documentation

◆ AddOrUpdateConsumer()

ConsumerInfo NATS.Client.JetStream.IJetStreamManagement.AddOrUpdateConsumer ( string  streamName,
ConsumerConfiguration  config 
)

Adds or updates a consumer.

Parameters
streamNameThe name of the stream the consumer is attached to.
configThe consumer configuration to use.
Returns

◆ AddStream()

StreamInfo NATS.Client.JetStream.IJetStreamManagement.AddStream ( StreamConfiguration  config)

Loads or creates a stream.

Parameters
configThe stream configuration to use.
Returns
Stream information

◆ DeleteConsumer()

bool NATS.Client.JetStream.IJetStreamManagement.DeleteConsumer ( string  streamName,
string  consumer 
)

Deletes a consumer.

Parameters
streamNameThe name of the stream the consumer is attached to.
consumerThe name of the consumer.
Returns
True if the consumer was deleted.

◆ DeleteMessage() [1/2]

bool NATS.Client.JetStream.IJetStreamManagement.DeleteMessage ( string  streamName,
ulong  sequence 
)

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

Parameters
streamNameThe name of the stream.
sequenceThe stream sequence number of the message.
Returns
True if the message was deleted.

◆ DeleteMessage() [2/2]

bool NATS.Client.JetStream.IJetStreamManagement.DeleteMessage ( string  streamName,
ulong  sequence,
bool  erase 
)

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

Parameters
streamNameThe name of the stream.
sequenceThe stream sequence number of the message.
eraseWhether to erase the message (overwriting with garbage) or only mark it as erased.
Returns
True if the message was deleted.

◆ DeleteStream()

bool NATS.Client.JetStream.IJetStreamManagement.DeleteStream ( string  streamName)

Deletes an existing stream.

Parameters
streamNameThe name of the stream.
Returns
true if the delete succeeded. Usually throws a NATSJetStreamException otherwise

◆ GetConsumerInfo()

ConsumerInfo NATS.Client.JetStream.IJetStreamManagement.GetConsumerInfo ( string  streamName,
string  consumer 
)

Gets information for an existing consumer.

Parameters
streamNameThe name of the stream the consumer is attached to.
consumerThe name of the consumer.
Returns
Consumer information

◆ GetConsumerNames()

IList< string > NATS.Client.JetStream.IJetStreamManagement.GetConsumerNames ( string  streamName)

Gets all consumers attached to a stream.

Parameters
streamNameThe name of the stream.
Returns
An array of consumer names.

◆ GetConsumers()

IList< ConsumerInfo > NATS.Client.JetStream.IJetStreamManagement.GetConsumers ( string  streamName)

Get consumer information for all consumers on a stream.

Parameters
streamNameThe name of the stream.
Returns
An array of consumer information objects.

◆ GetFirstMessage()

MessageInfo NATS.Client.JetStream.IJetStreamManagement.GetFirstMessage ( string  streamName,
string  subject 
)

Get MessageInfo for the first message of the subject.

Parameters
streamNameThe name of the stream.
subjectThe subject to get the first message for.
Returns
Message information.

◆ GetJetStreamContext()

IJetStream NATS.Client.JetStream.IJetStreamManagement.GetJetStreamContext ( )

Gets a context for publishing and subscribing to subjects backed by Jetstream streams and consumers, using the same connection and JetStreamOptions as the management.

Returns
The JetStream Context

◆ GetLastMessage()

MessageInfo NATS.Client.JetStream.IJetStreamManagement.GetLastMessage ( string  streamName,
string  subject 
)

Get MessageInfo for the last message of the subject.

Parameters
streamNameThe name of the stream.
subjectThe subject to get the last message for.
Returns
Message information.

◆ GetMessage()

MessageInfo NATS.Client.JetStream.IJetStreamManagement.GetMessage ( string  streamName,
ulong  sequence 
)

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

Parameters
streamNameThe name of the stream.
sequenceThe stream sequence number of the message.
Returns
Message information.

◆ GetNextMessage()

MessageInfo NATS.Client.JetStream.IJetStreamManagement.GetNextMessage ( string  streamName,
ulong  sequence,
string  subject 
)

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

Parameters
streamNameThe name of the stream.
sequenceThe first possible sequence number of the message.
subjectThe subject to get the next message for.
Returns
Message information.

◆ GetStreamInfo() [1/2]

StreamInfo NATS.Client.JetStream.IJetStreamManagement.GetStreamInfo ( string  streamName)

Get information about a stream. Does not retrieve any optional data. See the overloaded version that accepts StreamInfoOptions

Parameters
streamNameThe name of the stream.
Returns
Stream information

◆ GetStreamInfo() [2/2]

StreamInfo NATS.Client.JetStream.IJetStreamManagement.GetStreamInfo ( string  streamName,
StreamInfoOptions  options 
)

Get information about a stream, and include optional information as defined in the StreamInfoOptions.

Parameters
streamNameThe name of the stream.
optionsthe stream info options. If null, request will not return any optional data.
Returns
Stream information

◆ GetStreamNames() [1/2]

IList< string > NATS.Client.JetStream.IJetStreamManagement.GetStreamNames ( )

Gets the names of all streams.

Returns
An array of stream names.

◆ GetStreamNames() [2/2]

IList< string > NATS.Client.JetStream.IJetStreamManagement.GetStreamNames ( string  subjectFilter)

Get a list of stream names that have subjects matching the subject filter.

Parameters
subjectFilterThe subject. Wildcards are allowed.
Returns

◆ GetStreams() [1/2]

IList< StreamInfo > NATS.Client.JetStream.IJetStreamManagement.GetStreams ( )

Gets stream information about all streams.

Returns
An array of stream information objects.

◆ GetStreams() [2/2]

IList< StreamInfo > NATS.Client.JetStream.IJetStreamManagement.GetStreams ( string  subjectFilter)

Gets stream information about all streams that have subjects matching the filter.

Returns
An array of stream information objects.

◆ PauseConsumer()

ConsumerPauseResponse NATS.Client.JetStream.IJetStreamManagement.PauseConsumer ( string  streamName,
string  consumer,
DateTime  pauseUntil 
)

Pauses a consumer.

Parameters
streamNameThe name of the stream the consumer is attached to.
consumerThe name of the consumer.
pauseUntilConsumer is paused until this time.
Returns
ConsumerPauseResponse.

◆ PurgeStream() [1/2]

PurgeResponse NATS.Client.JetStream.IJetStreamManagement.PurgeStream ( string  streamName)

Purges all messages in a stream.

Parameters
streamNameThe name of the stream.
Returns
The result of the purge.

◆ PurgeStream() [2/2]

PurgeResponse NATS.Client.JetStream.IJetStreamManagement.PurgeStream ( string  streamName,
PurgeOptions  options 
)

Purges all messages in a stream.

Parameters
streamNameThe name of the stream.
optionsThe purge options.
Returns
The result of the purge.

◆ ResumeConsumer()

bool NATS.Client.JetStream.IJetStreamManagement.ResumeConsumer ( string  streamName,
string  consumer 
)

Resumes a consumer.

Parameters
streamNameThe name of the stream the consumer is attached to.
consumerThe name of the consumer.
Returns
True if the resume succeeded.

◆ UpdateStream()

StreamInfo NATS.Client.JetStream.IJetStreamManagement.UpdateStream ( StreamConfiguration  config)

Updates an existing stream.

Parameters
configThe stream configuration to use.
Returns
Stream information

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