drew-herron / nats.lv

LabVIEW client for NATS, the cloud native messaging system.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

GitHub Contributors Stars Forks Open Issues languagelanguage License

LabVIEW NATS Client

NATS Core palette

Neural Autonomic Transport System (NATS) is a lightweight publish/subscribe messaging protocol built on top of TCP/IP that provides at-most-once QoS messaging.

The entire toolkit is written in native LabVIEW and requires no external dependencies to run the code (other than a freely available functioning NATS server).

For an in-depth look at the NATS client protocol, visit the official documentation.

To learn more about NATS and to download the free, open-source server application visit https://nats.io

Installation

You can install NATS Core with VI Package Manager.

Requirements

Features

  • Written entirely in LabVIEW with no additional package dependencies

  • Supports publishing client commands: CONNECT, PUB, HPUB, SUB, UNSUB, PING, PONG

  • Supports reading server messages: INFO, MSG, HMSG, PING, PONG, +OK, -ERR

  • Server INFO and client CONNECT commands kept in JSON format to aid in futureproofing

  • Automatic PONG response to server PING requests for keep-alive functionality

  • Server/client configuration checks to verify if HPUB can be used

  • Supports usage of subscriber queue groups

  • TCP connection refnum exposed to allow use of LabVIEW 2020 native TLS

Getting Started

Running a NATS Server

Running a NATS server is quick and easy because there is no software installation. You can simply download a precompiled binary from the official NATS site and run it from any location.

Note: The precompiled binary for linux-386 runs on a cRIO 904x without needing to download any other dependencies. Last tested with nats-server v2.8.4 (May 2022).

Location on Palette

The NATS Core palette is added to the Functions >> Data Communication palette.

Data Communication palette

Examples

There are currently two examples included with the NATS Core package: a simple NATS writer and a simple NATS reader. These examples can be accessed through the NI Example Finder ( Help >> Find Examples... )

Example Finder location


Simple Reader Example

reader example


Simple Publisher Example

writer example

JetStream

This is not a JetStream enabled client.

Contributing

Contributions are what make the open source community such an amazing place to be, learn, inspire, and create. Any contributions you make are greatly appreciated.

  1. Fork the Project
  2. Create your Feature Branch (git checkout -b feature/AmazingFeature)
  3. Commit your Changes (git commit -m 'Add some AmazingFeature')
  4. Push to the Branch (git push origin feature/AmazingFeature)
  5. Open a Pull Request

Keep in mind that LabVIEW VIs are binary files, which are difficult to merge.

  • Only change a single VI or library.
  • Avoid conflicts with other pull requests (don't work on the same libraries or VIs).
  • Send VI Snippets (via issues) instead of pull requests when possible.

This section shamelessly stolen from the LabVIEW Composition project. I couldn't have said it better myself.

License

Unless otherwise noted, the NATS Core source files are distributed under the BSD 3-clause license found in the LICENSE file.

Acknowledgements

Thanks to everyone that publishes LabVIEW libraries for public use.

About

LabVIEW client for NATS, the cloud native messaging system.

License:BSD 3-Clause "New" or "Revised" License


Languages

Language:LabVIEW 100.0%