-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathconfig.py
More file actions
32 lines (26 loc) · 1.42 KB
/
config.py
File metadata and controls
32 lines (26 loc) · 1.42 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
import os
"""
This module handles the configuration settings for the application.
"""
from dotenv import load_dotenv
from pydantic import BaseSettings
load_dotenv()
class Settings(BaseSettings):
"""
Settings class for loading and managing environment variables.
Add any other variables or methods as required by the service.
Attributes:
app_name (str): The name of the application. Change this as per the need of your own service.
incoming_topic (str): The name of the incoming topic. Change as per the need of the service.
incoming_topic_subscription (str): The name of the subscription for the incoming topic. Change as per need.
outgoing_topic (str): The name of the outgoing topic. Change as per need.
storage_container (str): The name of the storage container. Change as per need.
max_concurrent_messages (int): The maximum number of concurrent messages. Default is the value of the environment variable 'MAX_CONCURRENT_MESSAGES' or 1 if not set.
"""
# Load environment variables from .env file
app_name: str = 'Python MS Core Template'
incoming_topic: str = 'incoming-topic' # Change this
incoming_topic_subscription: str = 'incoming-sub' # Change this
outgoing_topic: str = 'outgoing-topic' # Change this
storage_container: str = 'storage-container' # Change this
max_concurrent_messages: int = os.environ.get('MAX_CONCURRENT_MESSAGES', 1)