Skip to main content

Upgrading from MSMQ to NATS

A standard single-server upgrade needs no action. This page describes what the upgrade does so you know what to expect and how to confirm it worked.

What the Upgrade Does​

The installer:

  1. Stops the JAMS services.
  2. Installs the NATS server, the NATS admin CLI, and the message store folder.
  3. Creates the NATS TLS certificate and generates the NATS configuration.
  4. Starts the JAMSNATSServer service, then the JAMS services.

Then, on its first start, the JAMS Scheduler service:

  1. Creates its streams and consumer on NATS.
  2. Drains any messages left in the old MSMQ queues and deletes the queues.

The drain is done by the Scheduler, not the installer. A queue that was not drained is a Scheduler-startup question, and restarting the Scheduler retries it.

The installer no longer enables, requires, or checks for MSMQ.

Leave Message Queuing enabled until after the upgrade

If Message Queuing was enabled only for JAMS, you can remove the Windows feature, but only after a successful upgrade, once the old queues are gone. The drain treats an unavailable MSMQ as "nothing to do". If you remove the feature before upgrading, any messages still in the queues are lost without an error.

Failover pairs and SCOM
  • A failover pair needs TCP 4222 opened between the nodes, and the secondary's NATS certificate issued from the shared root CA. Follow NATS in a Failover Environment as part of the upgrade.
  • SCOM users must install the updated JAMS management pack, and only after JAMS is upgraded. See SCOM Integration with NATS.

Messages Left in the Old Queues​

Nothing is discarded. On the first start after the upgrade, the Scheduler drains the legacy queues:

Legacy queueWhat happens
.\Private$\JAMSRequestsEvery message is replayed through the normal handler, then the queue is deleted.
.\Private$\JAMStoSCOMEvery alert is republished to NATS, then the queue is deleted. An alert is removed only after its republish is confirmed. If any republish fails the queue is kept and the drain is retried on the next start.

Messages that were already in MSMQ are handled before any new NATS message. The drain removes itself: once the queue is gone, later starts do nothing.

In a Failover Pair​

Each node drains its own queue. An active node processes its drained messages itself. A passive node republishes them onto its local NATS stream, and its normal forwarding path delivers them to the active node. You do not have to promote a secondary to get its leftover messages processed.

note

Legacy MSMQ messages predate the per-message identity JAMS now uses for duplicate detection, so each drained message gets a new one as it is replayed. Handler errors on replayed messages, such as a completion for an Entry that no longer exists, are logged and skipped rather than retried.

If the Drain Cannot Finish​

If a message cannot be delivered, for example because NATS is not yet reachable, the message stays in the queue and the whole drain is retried on the next start. The Scheduler log records:

The MSMQ drain did not complete and will be retried on the next start: ...

A message whose body cannot be read is reported and dropped rather than blocking everything behind it.

Confirming the Upgrade​

The services are running:

Get-Service JAMSNATSServer, JAMSScheduler, JAMSServer, JAMSExecutor

The old queues are gone. This is the definitive check:

Get-MsmqQueue -Name "JAMSRequests","JAMStoSCOM" -ErrorAction SilentlyContinue

No output means both queues were drained and deleted. If a queue is still there, check the Scheduler log for the reason and restart the Scheduler to retry.

note

A clean drain leaves no line in the Scheduler log at default trace settings, so do not look for one. A failed drain is logged at Error level and is visible.

Messaging works end to end. Submit a Job and confirm it runs and completes. For a deeper check, see Monitoring the NATS Server.

Behavior Changes to Be Aware Of​

  • Uncollected SCOM alerts now expire after seven days. Under MSMQ they accumulated indefinitely. See SCOM Integration with NATS.
  • Messages are capped at 4 MiB. The realistic way to hit this is a Sequence or Workflow Job persisting a very large amount of state. The limit is configurable. See Configuring the NATS Server.
  • A new folder to exclude from antivirus. C:\ProgramData\JAMS\NATS holds in-flight message data. Treat it like the other JAMS data folders.

Downgrading​

warning

Downgrading from a NATS version of JAMS back to an MSMQ version is not a supported path. The upgrade deletes the MSMQ queues and adds objects to the JAMS database that earlier versions do not know about. If you need the option to return to your previous version, take a full backup of the JAMS database and a system-state backup of the Scheduler machine before upgrading, and restore both together. Contact JAMS Support before attempting a downgrade.