Nats .NET Client Samples
July 22, 2024 ยท View on GitHub

Nats .NET Client Samples
This folder contains a number of samples:
Core Nats
Publish- A sample publisher.QueueGroup- An example queue group subscriber.Requestor- A requestor sample.Replier- A sample replier for the Requestor application.RxSample- Rx integration / functionalitySubscribe- A sample subscriber.WinFormsSample- Use the client within a Windows application.TlsVariationsExample- Some examples setting up the client for TLSJetStreamStarter- A starter app for JetStream projects.
Simplification
Examples show the simplification JetStream stream and consume api.
SimplificationContext- Examples on how to get simplification stream and consumer contexts.SimplificationFetchBytes- How to fetch with byte limits.SimplificationFetchMessages- How to fetch with message limits.SimplificationIterableConsumer- How to endlessly consume with an iteration pattern.SimplificationMessageConsumer- How to endless consume with an Event HandlerSimplificationNext- How to consume one message at a time.
JetStream
JetStreamPublish- publish JetStream messagesJetStreamPublishAsync- publish JetStream messages asynchronouslyJetStreamPublishVsCorePublish- publish JetStream messages versus core publish to the same stream.JetStreamPublishWithOptionsUseCases- publish JetStream with examples on using publish optionsJetStreamPullSubBatchSize- pull subscription example specifying batch size and manual handlingJetStreamPullSubBatchSizeUseCases- pull subscription example specifying batch size with examples of manual handling various cases of available messagesJetStreamPullSubExpiresIn- pull subscription example specifying expiration and manual handlingJetStreamPullSubExpiresInUseCases- pull subscription example specifying expiration with examples of manual handling various cases of available messagesJetStreamPullSubFetch- pull subscription example using fetch list macro functionJetStreamPullSubFetchUseCases- pull subscription example using fetch list macro function with examples of various cases of available messagesJetStreamPullSubIterate- pull subscription example using iterate macro functionJetStreamPullSubIterateUseCases- pull subscription example using iterate macro function with examples of various cases of available messagesJetStreamPullSubNoWaitUseCases- pull subscription example specifying no wait with examples of manual handling various cases of available messagesJetStreamPushSubscribeBasicAsync- push subscribing to read messages asynchronously and manually acknowledge messages.JetStreamPushSubscribeBasicSync- push subscribing to read messages synchronously and manually acknowledges messages.JetStreamPushSubscribeBindDurable- push subscribing with the bind optionsJetStreamPushSubscribeDeliverSubject- push subscribing with a deliver subject and how the subject can be read as a regular Nats MessageJetStreamPushSubscribeFilterSubject- push subscribing with a filter on the subjects.JetStreamPushSubscribeQueueDurable- push subscribing to read messages in a load balance queue using a durable consumer.
JetStream Management / Admin
JetStreamManageConsumers- demonstrate the management of consumersJetStreamManageStreams- demonstrate the management of streams
Key Value
KeyValueFull- complete example showing aspects of KV operation
Service Framework
ServiceExample- complete example showing service running and discovery
Miscellany
The miscellany is just a general purpose project with other examples
NatsByExample- copies of projects put into the NatsByExample websiteKvIntro- introduction to Key ValuePubSub- basic publish subscribeRequestReply- basic request reply
ScatterGather- one publish many replies.ServiceCrossClientValidator- a testing program to validate the service api
Sample Support
ExampleArgs- Helper to manage command line arguments.ExampleAuthHandler- Example of an auth handler.ExampleUtils- Miscellaneous utils used to start or in running examples.JetStreamExampleUtils- Miscellaneous utils specific to JetStream examples.
Example Ideas
JetStreamPushSubscribeFlowControlJetStreamPushSubscribeHeartbeatJetStreamMirrorSubUseCasesJetStreamPrefix