NATS
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 Client | UNIX, Windows | NA | Instance-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$ | ||||
NATSClient | discovered process | cmd | match | 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:
Port
The NATS Server pattern attempts to retrieve the port from the trigger process arguments by using the following regular expression:
If not available, the pattern attempts to extract it from the contents of the configuration file by using the following regular expression:
Instance
The NATS Server pattern attempts to retrieve the instance from the trigger process arguments by using the following regular expression:
Active versioning
The NATS Server pattern uses active versioning and runs the following command:
and parses the results of the command execution by using the following regular expression:
Path versioning
The NATS Server pattern attempts to retrieve the version from the trigger process cmd by using the following regular expression:
The pattern also looks for the version information in the package that matches the following regular expression:
and extracts it by using the following regular expression:
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.