The JAMS NATS Server Service
The JAMS installer adds one Windows service to host the message broker.
Service Identity
| Property | Value |
|---|---|
| Service name | JAMSNATSServer |
| Display name | JAMS NATS Server |
| Description | The JAMS NATS server provides messaging services. |
| Startup type | Automatic |
| Account | LocalSystem, the same as the other JAMS services |
| Recovery | Restart on the first and second failure after 60 seconds. The failure count resets daily. |
| Removed on uninstall | Yes |
Use the service name in PowerShell:
Get-Service JAMSNATSServer
Restart-Service JAMSNATSServer -Force
The service runs the bundled broker with the JAMS configuration file:
"C:\Program Files\MVPSI\JAMS\Scheduler\NATS\jams-nats-server.exe" -c "C:\Program Files\MVPSI\JAMS\Scheduler\NATS\nats-server.conf"
The JAMS Services Depend on It
The JAMS Scheduler, JAMS Server, and JAMS Executor services have a Windows service dependency on JAMSNATSServer, the same relationship they had with MSMQ.
Windows enforces the dependency, so the JAMS services cannot start until the NATS service is running. If all three JAMS services fail to start after an install, upgrade, or configuration change, check JAMSNATSServer first. See Troubleshooting NATS.
Windows starts and stops the services in dependency order. Stopping JAMSNATSServer by hand prompts you to stop the dependent JAMS services with it.
Installed Files
The installer creates a NATS folder inside the Scheduler folder. By default that is C:\Program Files\MVPSI\JAMS\Scheduler\NATS.
Three files come from the installer:
| File | Purpose |
|---|---|
jams-nats-server.exe | The NATS broker. This is the stock nats-server, version 2.14.1. |
nats.exe | The NATS administration CLI, version 0.4.0. See Using the NATS Admin CLI. |
LICENSE | The NATS license. |
The rest are generated on the machine during setup:
| File | Purpose |
|---|---|
nats-server.conf | Your configuration file. Kept across upgrades. |
nats-server-defaults.conf | Defaults maintained by JAMS. Regenerated. Do not edit. |
nats-server-cert.pem | The server's TLS certificate. |
nats-server-key.pem | The private key for that certificate. |
nats-ca.pem | The JAMS root CA certificate, used to verify clients. |
nats-server.log | The broker's log, written once the service runs. |
See Configuring the NATS Server and NATS TLS Certificates.
Setup removes BUILTIN\Users access from the NATS folder so that standard users cannot read the unencrypted private key.
Uninstalling JAMS removes the service and the three installed files. The configuration files, the log, the three .pem files (including the unencrypted private key), and the message store under C:\ProgramData\JAMS\NATS stay on disk. Remove them by hand if you are decommissioning the machine. See NATS TLS Certificates.
Message Store
Reliable messages are stored outside the program folder so they survive an upgrade:
C:\ProgramData\JAMS\NATS
Setup creates this folder and removes BUILTIN\Users access, because it holds message payloads. Exclude it from real-time antivirus scanning, along with your other JAMS data folders.
The folder grows while reliable messages wait to be processed and shrinks as they are acknowledged. On a healthy system it stays small. Sustained growth means the Scheduler is not keeping up, or is not consuming at all. See Monitoring the NATS Server.
Service Account
There is normally no reason to change the account. The NATS service needs no database or network credentials. It only listens for connections. If you do move it to a dedicated Windows account, that account needs:
- Read access to the three
.pemfiles in the NATS folder. - Read and write access to
C:\ProgramData\JAMS\NATS.
Both folders have restricted permissions, so grant the access explicitly. The same applies to any other account that must read the certificates, such as a SCOM RunAs account. See SCOM Integration with NATS.
One Instance per Machine
Only one NATS server can bind the client port. If a second copy is started, for example a hand-launched jams-nats-server.exe, it fails and records the reason in nats-server.log.