NATS


You must log in or register to view this page

NATS is a simple, secure, and high-performance open-source data layer for cloud native applications, IoT messaging, and microservices architectures.

Software pattern summary

The following table gives an overview of the pattern characteristics:

Product component

OS type

Versioning

Pattern depth

NATS Server

UNIX, Windows

Active, Path

Instance-based

NATS ClientUNIX, WindowsNAInstance-based

Platforms supported by the pattern

The patterns discover NATS deployments on UNIX and Windows platforms.

Identification

To run a discovery of the product, the pattern must be triggered. This section describes conditions under which the pattern can be triggered.

Software instance triggers

The following table gives details about the pattern triggers:

Pattern

Trigger node

Attribute

Condition

Argument

NATSServer

discovered process 

cmd

match

regex

\bnats\-server(?:\-current)?$

or

regex

(?i)\bnats\-server(?:\-current)?\.exe$
or

regex

\bgnatsd$
NATSClientdiscovered process cmdmatch

regex

\bnats$
or

regex

(?i)\bnats\.exe$

Simple identification mappings

The following components/processes are identified by using the simple identity mappings that map the product's known processes:

Name

Command

NATS CLI

regex

\bnats$
NATS CLI

regex

(?i)\bnats\.exe$
NATS Server

regex

\bnats\-server$
NATS Server

regex

(?i)\bnats\-server\.exe$

Obtaining install root

On the Windows platform, the NATS Server pattern extracts the install root from the trigger process command line by using the following regular expressions:

  • (?i)^(\w\:.+)\\nats\-server(?:\-current)?\.exe$
  • ^(/\S+)/

On the Windows platform, the NATS Client pattern extracts the install root from the trigger process command line by using the following regular expressions:

  • (?i)^(\w\:.+)\\nats\.exe$
  • ^(/\S+)/nats$

Versioning

Version information for the product is collected by parsing the config file, port, and instance. The pattern also uses the file and path versioning methods.

Config file

The NATS Server pattern attempts to retrieve the path to the configuration file from the trigger process arguments by using the following regular expression:

\-\-?c(?:onfig)?\s['"]?(.+?\.conf)

Port

The NATS Server pattern attempts to retrieve the port from the trigger process arguments by using the following regular expression:

\-\-?p(?:ort)?\s(\d+)

If not available, the pattern attempts to extract it from the contents of the configuration file by using the following regular expression:

(?m)^(?:http_)?port\:\s(\d+)

Instance

The NATS Server pattern attempts to retrieve the instance from the trigger process arguments by using the following regular expression:

\-\-?(?:server_)?n(?:ame)?\s(\w+)

Active versioning

The NATS Server pattern uses active versioning and runs the following command:

"<install_root>\\nats-server.exe" --version

and parses the results of the command execution by using the following regular expression:

(\d+(?:\.\d+)*)

Path versioning

The NATS Server pattern attempts to retrieve the version from the trigger process cmd by using the following regular expression: 

(?i)[/\\]nats\-server\-(?:bin[/\\]|v)(\d+(?:\.\d+)*)

The pattern also looks for the version information in the package that matches the following regular expression:

(?i)Bamboo Continuous Integration Server

and extracts it by using the following regular expression:

(\d+(?:\.\d+)*)

Application model

If the pattern discovers a SoftwareInstance of NATS, it defines its architecture in the form of the application model.

Pattern trigger

The NATS Server pattern is triggered by a nats-server or nats-server.exe process. The NATS Client pattern is triggered by nats or nats.exe process.

SI depth

The NATS Server pattern creates an instance-based Software Instance with the key based on the instance name, port, SI type, and host key. The NATS Client pattern creates an instance-based Software Instance with the key based on the SI type and host key.

Relationship creation

The pattern creates a client-server relationship between a NATS Server and a NATS Client.

Subject matter expertise

Inputs from subject matter experts are welcome on any other potential approaches not discussed in this topic.

Open issues

There are no known open issues with this pattern.

 

Tip: For faster searching, add an asterisk to the end of your partial query. Example: cert*