| from pydantic import BaseSettings, AnyUrl | |
| from typing import Optional, Dict | |
| class Settings(BaseSettings): | |
| # AMQP | |
| AMQP_URL: AnyUrl # e.g. amqps://user:pass@host:5671/%2F?heartbeat=30 | |
| RABBIT_INSTANCE_NAME: str = "prod" | |
| RABBIT_EXCHANGE_TYPE: str = "topic" # match your .NET Type | |
| RABBIT_ROUTING_KEY: str = "" # match your .NET RoutingKeys ("" ok) | |
| RABBIT_PREFETCH: int = 1 | |
| # Service identity | |
| SERVICE_ID: str = "monitor" # "monitor"|"nmap"|... | |
| USE_TLS: bool = True | |
| # Optional exchange type overrides by prefix, like .NET ExchangeTypes | |
| EXCHANGE_TYPES: Dict[str, str] = {} | |
| class Config: | |
| case_sensitive = True | |
| settings = Settings() # env-driven | |