# `PhoenixMicro.Config`
[🔗](https://github.com/iamkanishka/phoenix_micro/blob/v1.0.0/lib/phoenix_micro/config.ex#L1)

Centralised configuration loader and validator for `phoenix_micro`.

Configuration lives in `config/*.exs`:

    config :phoenix_micro,
      transport: :rabbitmq,
      transports: [
        rabbitmq: [url: "amqp://localhost"],
        kafka: [brokers: [{"localhost", 9092}], group_id: "my_app"],
        nats: [host: "localhost", port: 4222],
        memory: []
      ],
      default_timeout: 5_000,
      default_retry: [max_attempts: 3, base_delay: 500],
      serializer: PhoenixMicro.Serializer.JSON,
      telemetry_enabled: true

Runtime config via `{:system, "ENV_VAR"}` tuples is also supported.

# `active_transport`

```elixir
@spec active_transport() :: atom()
```

Returns the active (default) transport module atom.

# `get`

```elixir
@spec get() :: keyword() | map()
```

Returns the fully-validated application configuration.
Raises `NimbleOptions.ValidationError` on bad config.

# `get`

```elixir
@spec get(atom(), term()) :: term()
```

Returns a single top-level config key with an optional default.

# `retry_opts`

```elixir
@spec retry_opts(keyword()) :: keyword()
```

Returns the retry options, merging consumer-level overrides with defaults.

# `transport_config`

```elixir
@spec transport_config(atom()) :: keyword() | map()
```

Returns the config for a specific transport.

# `transport_module`

```elixir
@spec transport_module(atom()) :: module()
```

Maps a transport atom name to its implementation module.

---

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