# `PhoenixMicro.Transport.NATS`
[🔗](https://github.com/iamkanishka/phoenix_micro/blob/v1.0.0/lib/phoenix_micro/transport/nats.ex#L1)

NATS transport adapter using `Gnat`.

`phoenix_micro` lists **no gnat dependency** — add it to YOUR app's `mix.exs`:

    {:gnat, "~> 1.7"}

Gnat is pure Elixir — no rebar3, no C compiler, works on all platforms.

## Features

- Core NATS pub/sub with native wildcard support (`*`, `>`).
- Queue groups for load-balanced consumer groups.
- Request/reply for RPC patterns.
- Automatic reconnect with exponential backoff on connection loss.
- Task.Supervisor-based dispatch (crashes don't kill the transport).
- Full telemetry coverage.

## Configuration

    config :phoenix_micro,
      transport: :nats,
      transports: [
        nats: [
          host: "localhost",
          port: 4222,
          queue_group: "my_app",
          username: "user",    # optional
          password: "pass",    # optional
          tls: false           # optional
        ]
      ]

# `child_spec`

```elixir
@spec child_spec(keyword()) :: Supervisor.child_spec()
```

Returns a specification to start this module under a supervisor.

See `Supervisor`.

# `start_link`

```elixir
@spec start_link(keyword()) :: GenServer.on_start()
```

---

*Consult [api-reference.md](api-reference.md) for complete listing*
