Skip to content
LambogeniusDocs

HL7 Edge Gateway

High availability

Run several gateways on NATS JetStream, active/passive behind one address.

Runs onWindows · Linux · macOS · DockerFree developer license for test traffic. Production traffic needs a paid license.

A cluster that keeps messages in order

A single gateway keeps its queue in an embedded, crash-safe store on local disk. For high availability, run two or more gateways with the same configuration on a NATS JetStream cluster:

  1. 1
    Run 3 NATS servers with JetStream enabled.

    They can share hosts with the gateways.

  2. 2
    Point every gateway at them.
    [store]
    backend = "jetstream"
    urls = ["nats://nats1:4222", "nats://nats2:4222", "nats://nats3:4222"]
    replicas = 3
    ack_wait = "60s"        # failover delay if a node dies mid-delivery; must exceed request_timeout + 5s
    dedup_window = "2m"
    dead_letter_max_age = "30d"
  3. 3
    Give the sender one address.

    A virtual IP (keepalived/VRRP, Windows NLB) or a TCP load balancer (F5, HAProxy), run active/passive, with GET /ready on the admin port as the health check.

Guarantees

  • AA only after replication: the sender gets AA once JetStream has stored the message on a quorum of servers.
  • Order: at most one message per route is in flight across the whole cluster.
  • Failover: if a node dies mid-delivery, another picks the message up after ack_wait. After a graceful stop or a pause, immediately.
  • At-least-once: the target can see a duplicate if a node crashes after the target accepted a message but before the gateway recorded it. Use X-Hl7-Control-Id to deduplicate.