Skip to content

NATS Configuration

Anthony Bible edited this page Aug 25, 2025 · 1 revision

NATS Configuration

Keys

  • nats.url (string): NATS server URL (default nats://localhost:4222)
  • nats.max_reconnects (int): Maximum reconnect attempts (default 5)
  • nats.reconnect_wait (duration): Delay between reconnects (default 2s)

Environment variables

  • CODECHUNK_NATS_URL
  • CODECHUNK_NATS_MAX_RECONNECTS
  • CODECHUNK_NATS_RECONNECT_WAIT

Example (YAML)

nats:
  url: nats://localhost:4222
  max_reconnects: 10
  reconnect_wait: 5s

Example (ENV)

export CODECHUNK_NATS_URL=nats://nats:4222
export CODECHUNK_NATS_MAX_RECONNECTS=10
export CODECHUNK_NATS_RECONNECT_WAIT=5s

See also

Source files

  • internal/config/config.go (NATSConfig)
  • cmd/worker.go (NATS usage)
  • internal/adapter/outbound/messaging/nats_message_publisher.go (publisher config)

Clone this wiki locally