Skip to main content
NATSEventBridge publishes events to a NATS subject and subscribes to the same subject for inbound forwarding.

Go support

NATSEventBridge is not implemented in abxbus-go yet. Use JSONLEventBridge for the currently supported Go bridge.

Optional dependencies

Install the NATS extra (recommended):
Equivalent direct dependency install:

Constructor params

  • server: NATS server URL (for example nats://localhost:4222)
  • subject: subject name used for publish/subscribe
  • name: optional bridge label

Setup with a bus

Behavior

  • emit(...) publishes serialized event JSON bytes to the configured subject.
  • on(...) registers inbound handlers and auto-starts subscription.
  • Inbound messages are decoded, reset, and re-emitted on the internal bus.
  • close() drains/closes NATS connections and stops the internal bus.
  • Runtime requirements: Python needs nats-py, TypeScript needs nats and Node.js.