feat: fix
This commit is contained in:
17
external/kafka/producer.py
vendored
17
external/kafka/producer.py
vendored
@@ -1,10 +1,17 @@
|
|||||||
|
from typing import Optional
|
||||||
|
|
||||||
from aiokafka import AIOKafkaProducer
|
from aiokafka import AIOKafkaProducer
|
||||||
|
|
||||||
from backend.config import KAFKA_URL
|
from backend.config import KAFKA_URL
|
||||||
from external.kafka.context import context
|
from external.kafka.context import context
|
||||||
|
|
||||||
producer = AIOKafkaProducer(
|
producer: Optional[AIOKafkaProducer] = None
|
||||||
bootstrap_servers=KAFKA_URL,
|
|
||||||
security_protocol='SSL',
|
|
||||||
ssl_context=context,
|
async def init_producer():
|
||||||
)
|
global producer
|
||||||
|
producer = AIOKafkaProducer(
|
||||||
|
bootstrap_servers=KAFKA_URL,
|
||||||
|
security_protocol='SSL',
|
||||||
|
ssl_context=context,
|
||||||
|
)
|
||||||
|
|||||||
Reference in New Issue
Block a user