feat: fix
This commit is contained in:
12
external/kafka/consumer.py
vendored
12
external/kafka/consumer.py
vendored
@@ -6,15 +6,15 @@ from backend.session import session_maker
|
|||||||
from external.kafka.context import context
|
from external.kafka.context import context
|
||||||
from external.kafka.services.consumer_service import ConsumerService
|
from external.kafka.services.consumer_service import ConsumerService
|
||||||
|
|
||||||
consumer = AIOKafkaConsumer(
|
|
||||||
KAFKA_CONSUMER_TOPIC,
|
|
||||||
bootstrap_servers=KAFKA_URL,
|
|
||||||
security_protocol='SSL',
|
|
||||||
ssl_context=context,
|
|
||||||
)
|
|
||||||
|
|
||||||
|
|
||||||
async def consume_messages():
|
async def consume_messages():
|
||||||
|
consumer = AIOKafkaConsumer(
|
||||||
|
KAFKA_CONSUMER_TOPIC,
|
||||||
|
bootstrap_servers=KAFKA_URL,
|
||||||
|
security_protocol='SSL',
|
||||||
|
ssl_context=context,
|
||||||
|
)
|
||||||
try:
|
try:
|
||||||
await consumer.start()
|
await consumer.start()
|
||||||
except KafkaConnectionError as e:
|
except KafkaConnectionError as e:
|
||||||
|
|||||||
Reference in New Issue
Block a user