# Appsettings This page explains how Ksql.Linq reads configuration and which keys are commonly used. ## Sources and precedence (override order) Ksql.Linq uses the standard .NET configuration stack. Later sources override earlier ones: - Code (builder / Fluent APIs) - Environment variables (`DOTNET_...` / `KsqlDsl__...` etc.) - `appsettings.{Environment}.json` - `appsettings.json` - Library defaults Note: The typical .NET pattern is AddJsonFile → AddEnvironmentVariables → AddCommandLine; the last wins. `KsqlContextBuilder` respects the resolved `IConfiguration` you pass in. ## Minimal configuration ```json { "KsqlDsl": { "Common": { "BootstrapServers": "localhost:9092", "ClientId": "my-app" }, "SchemaRegistry": { "Url": "http://localhost:8081" }, "KsqlDbUrl": "http://localhost:8088", "DlqTopicName": "dead-letter-queue", "DeserializationErrorPolicy": "DLQ" } } ``` ## Key sections - `KsqlDsl.Common.*`: base Kafka Producer/Consumer options (e.g., `BootstrapServers`) - `KsqlDsl.SchemaRegistry.Url`: Schema Registry URL - `KsqlDsl.KsqlDbUrl`: ksqlDB REST URL - `KsqlDsl.DlqTopicName`, `KsqlDsl.DeserializationErrorPolicy`: DLQ settings - `KsqlDsl.Topics..Creation.*`: topic creation (partitions/replication/retention, etc.) - `KsqlDsl.Topics..Consumer|Producer.*`: per-topic consumer/producer options ## Secured Kafka (SASL_SSL) example ```json { "KsqlDsl": { "Common": { "BootstrapServers": ":9092,:9092", "SecurityProtocol": "SaslSsl", "SaslMechanism": "Plain", "SaslUsername": "${CLOUD_API_KEY}", "SaslPassword": "${CLOUD_API_SECRET}" }, "SchemaRegistry": { "Url": "https://:8081" }, "KsqlDbUrl": "https://:8088" } } ``` ## Table/TimeBucket state store (RocksDB) For how local state is used and maintained, see: [Tumbling-State-Store](Tumbling-State-Store) ## See also - Kafka connection options: [Appsettings-Kafka](Appsettings-Kafka) - Full configuration reference: [Configuration-Reference](Configuration-Reference)