CNCF and Synadia Align on Securing the Future of the NATS.io Project | Read the joint release ->

NATS Blog

Welcome to the NATS Blog! We have content from NATS Maintainers, end-users, and community contributors. We always appreciate outside contributions so if you would like to contribute a blog post, see our Contributor's Guide for more information.

Building Microservices with NATS

CHANAKA FERNANDO — November 18, 2021

Introduction Microservices are becoming a commodity in the enterprise world. The reason being the agility and the modularity it brings to the software development and delivery process. It is not that difficult to get started with microservices since there are enough tools and frameworks available to bootstrap the microservices-based application development. But there is a point that most teams who adopt microservices find it challenging to deal with. That is when the number of microservices goes beyond a certain limit (let’s say 25 in some cases), people start realizing the real challenges that microservices architecture brings to the table. Read more...

NATS.io .NET C# Client Library JetStream Pre-Release

SCOTT FAUERBACH — July 26, 2021

A pre-release of JetStream support has just been made available for the NATS .NET C# Client Library! The package NATS.Client 0.14.0-pre1 has been published on NuGet Gallery. You can follow progress and provide feedback via the Add Jetstream Connection/Client APIs GitHub Issue. Code Starting Points These are the important interfaces for you to get familiar with. IConnection has new methods which allow you to work with JetStream. CreateJetStreamManagementContext(...) gets an implementation of IJetStreamManagement , the interface that provides stream management functions. Read more...

NATS JetStream Deduplication for LinuxForHealth Blockchain Smart Contract Messaging

CAROLE CORLEY — July 19, 2021

Deduplication of messages is a key NATS JetStream feature needed by the LinuxForHealth open source project to implement blockchain smart contract messaging. Messaging from a smart contract allows the contract to notify NATS subscribers of key contract-based decisions. This is especially helpful for blockchain client applications that may not utilize a full blockchain node and can enable message-driven smart contract workflows. While messaging from a smart contract is desirable, every blockchain node runs the same smart contract and, as such, will publish the same NATS message. Read more...

JetStream for Key-Value Store Tech Preview

R.I. PIENAAR — July 15, 2021

Key-Value stores are specialised NoSQL databases that store values in a data bucket under a specific key. Key-Value stores are used extensively in modern cloud-native infrastructure, indeed etcd is the main storage engine of Kubernetes. In recent releases we have made several enhancements to JetStream with regard to wildcard subject support. In NATS Server 2.3.2 we have all of the features needed for NATS JetStream to be a powerful Key-Value store. Read more...

Using OCSP Stapling with the NATS Java Library

SCOTT FAUERBACH — July 6, 2021

You already know that the NATS Java library can connect to the NATS Server with TLS. The NATS Server now supports OCSP Stapling. To that end, I have built an example on how to set up the SSLContext to use with the NATS Java Library. Mileage may vary, and you will need to incorporate your own certificates and key stores, but this OCSP Example will get you most of the way there. Read more...

NATS Java Client Latency Benchmarking

SCOTT FAUERBACH — June 21, 2021

NATS Java Client Latency Benchmarking Many users have asked to see how the NATS Java client performs specifically in regard to latency. This blog will discuss using the NatsAutoBench program to run a latency test and how to generate a CSV file that can be used to make a histogram. The NatsAutoBench can run a variety of tests. This blog will focus only on the latency testing. Running the Latency Test You can run the latency test from an IDE or a command line, but you will need to build from the source code. Read more...

JetStream Pull Consumers with the NATS.io Java Library

SCOTT FAUERBACH — June 8, 2021

JetStream Pull Consumers with the NATS.io Java Library The last entry in this series talked about push consumers . This entry will demonstrate the basics of a pull subscription. Pull A pull subscription allows you to control when the server sends the client messages. There is one API method call used for creating a pull subscription: JetStreamSubscription subscribe(String subject, PullSubscribeOptions options) throws IOException, JetStreamApiException; subject - every subscription needs a subject options - configure PullSubscribeOptions or use the default configuration PullSubscribeOptions The PullSubscribeOptions allows you to identify the stream name and is a helper for the most common pull ConsumerConfiguration option, the durable name. Read more...

JetStream Push Consumers with the NATS.io Java Library

SCOTT FAUERBACH — June 3, 2021

JetStream Push Consumers with the NATS.io Java Library The last entry in this series talked about the consumer options that are available when subscribing to messages. This entry will demonstrate the basics of a push subscription. Push A push subscription is where the server is in control and sends messages to the client. It can be made durable or ephemeral based on your use case. Here are the API method calls used for creating a push subscription: Read more...

Synchronous and Asynchronous Publishing with the NATS.io Java Library

SCOTT FAUERBACH — May 27, 2021

Synchronous and Asynchronous Publishing with the NATS Java Library In the continuation of the series on using the NATS Java client with JetStream , there is new video that demonstrates publishing messages to a stream synchronously and asynchronously. Check out this video: The source code discussed in the video can be found here: PublishAsync PublishSync.java About the Author Scott Fauerbach is a member of the engineering team at Synadia Communications . Read more...

JetStream Consumers with the NATS.io Java Library

SCOTT FAUERBACH — May 21, 2021

The previous entries in this series showed us how to create JetStream streams and publish messages. This entry will start building up to subscribing by describing the configuration for consumers. Push vs Pull Subscription Consumers, once created, can subscribe as either a push or pull mode. The server sends messages to push consumers while pull consumers have to ask for messages. This is mentioned here first because consumer configuration options may apply differently depending on the type of subscription. Read more...