Code import - branch feature/SIENTIAPDE-1646
This commit is contained in:
19
scouter/utils/connectors_config.py
Normal file
19
scouter/utils/connectors_config.py
Normal file
@@ -0,0 +1,19 @@
|
||||
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',
|
||||
}
|
||||
Reference in New Issue
Block a user