47 lines
1.2 KiB
Python
47 lines
1.2 KiB
Python
from functools import lru_cache
|
|
|
|
from pydantic_settings import BaseSettings, SettingsConfigDict
|
|
|
|
|
|
class Settings(BaseSettings):
|
|
model_config = SettingsConfigDict(
|
|
env_file=".env",
|
|
env_file_encoding="utf-8",
|
|
extra="ignore",
|
|
)
|
|
|
|
kafka_bootstrap_servers: str = "localhost:19092"
|
|
kafka_raw_topic: str = "cdr.raw"
|
|
|
|
api_queue_size: int = 10_000
|
|
|
|
kafka_delivery_timeout_seconds: float = 4.0
|
|
kafka_message_timeout_ms: int = 3_000
|
|
|
|
kafka_linger_ms: int = 5
|
|
kafka_batch_size: int = 131_072
|
|
kafka_producer_max_messages: int = 100_000
|
|
|
|
kafka_dlq_topic: str = "cdr.raw.dlq"
|
|
kafka_consumer_group: str = "cdr-processing-workers"
|
|
kafka_auto_offset_reset: str = "earliest"
|
|
|
|
kafka_consumer_poll_timeout_seconds: float = 1.0
|
|
kafka_dlq_delivery_timeout_seconds: float = 5.0
|
|
|
|
worker_instance_id: str = "worker-1"
|
|
|
|
clickhouse_host: str = "localhost"
|
|
clickhouse_port: int = 8123
|
|
clickhouse_database: str = "telecom"
|
|
clickhouse_user: str = "telecom"
|
|
clickhouse_password: str = ""
|
|
|
|
batch_size: int = 1_000
|
|
batch_flush_interval_seconds: float = 2.0
|
|
|
|
|
|
@lru_cache
|
|
def get_settings() -> Settings:
|
|
return Settings()
|