Refactor PIWebAPIClient and Update Configuration Imports - Removed outdated PostgreSQL, Redis, MongoDB, and API configuration functions from connectors_config.py. - Deleted the pi_web_api_client.py file as part of the refactor. - Updated imports in worker.py and api.py to use the new repository structure. - Cleaned up scenarios.md by removing obsolete scenarios related to unique constraint violations. - Commented out the specific version of the sientia-dataops-library in requirements.txt for flexibility.
20 lines
693 B
Python
20 lines
693 B
Python
from os import getenv
|
|
from typing import Any
|
|
|
|
|
|
def build_kafka_config() -> dict[str, Any]:
|
|
"""
|
|
Build Kafka configuration from environment variables.
|
|
|
|
Returns:
|
|
dict[str, Any]: Kafka configuration dictionary with keys:
|
|
- bootstrap_servers: Kafka broker addresses (default: localhost:9092)
|
|
- polling_time: Consumer polling interval in milliseconds (default: 1000)
|
|
- group_id: Consumer group identifier (default: scouter-group)
|
|
"""
|
|
return {
|
|
'bootstrap_servers': getenv('KAFKA_BOOTSTRAP_SERVERS', 'localhost:9092'),
|
|
'polling_time': int(getenv('KAFKA_POLLING_TIME', '1000')),
|
|
'group_id': 'scouter-group',
|
|
}
|