Skip to content

Commit

Permalink
moved producer location and added logging.
Browse files Browse the repository at this point in the history
  • Loading branch information
dspeck1 committed Sep 30, 2024
1 parent 1a519bb commit aa70512
Showing 1 changed file with 8 additions and 7 deletions.
15 changes: 8 additions & 7 deletions src/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -158,13 +158,7 @@ async def main() -> None:
sasl_mechanism=sasl_mechanism,
sasl_plain_username=sasl_username,
sasl_plain_password=sasl_password,
)

# https://aiokafka.readthedocs.io/en/stable/producer.html
producer = AIOKafkaProducer(
bootstrap_servers=prompt_processing_kafka_cluster
)
await producer.start()
)

latiss_gauge = Gauge(
"latiss_next_visit_messages", "next visit nessages with latiss as instrument"
Expand Down Expand Up @@ -212,6 +206,13 @@ async def main() -> None:

tasks = set()

# https://aiokafka.readthedocs.io/en/stable/producer.html
producer = AIOKafkaProducer(
bootstrap_servers=prompt_processing_kafka_cluster
)
await producer.start()
logging.info ("started kafka producer")

async with httpx.AsyncClient() as client:

try:
Expand Down

0 comments on commit aa70512

Please sign in to comment.