feat: Semaine 8
This commit is contained in:
@@ -0,0 +1,17 @@
|
||||
from datetime import datetime, timezone
|
||||
from uuid import uuid4
|
||||
import os
|
||||
|
||||
TOPIC_ORDERS= "orders"
|
||||
TOPIC_PAYMENTS= "payments"
|
||||
TOPIC_NOTIFICATIONS= "notifications"
|
||||
|
||||
BOOTSTRAP_SERVERS= os.getenv("BOOTSTRAP_SERVERS", "localhost:9092")
|
||||
|
||||
def make_event(event_type: str, payload: dict) -> dict:
|
||||
return {
|
||||
"id": str(uuid4()),
|
||||
"type": event_type,
|
||||
"timestamp": datetime.now(timezone.utc).isoformat(),
|
||||
"payload": payload
|
||||
}
|
||||
Reference in New Issue
Block a user