Torma Kristóf
fe3537ff31
All checks were successful
continuous-integration/drone/push Build is passing
38 lines
987 B
Python
38 lines
987 B
Python
#!/usr/bin/env python
|
|
import random
|
|
import time
|
|
import uuid
|
|
import logging
|
|
import sentry_sdk
|
|
from communicator import Communicator
|
|
from consumerlocator import ConsumerLocator
|
|
from messagesender import MessageSender
|
|
|
|
|
|
"""
|
|
Main entrypoint
|
|
"""
|
|
|
|
__author__ = "@tormakris"
|
|
__copyright__ = "Copyright 2020, GoldenPogácsa Team"
|
|
__module_name__ = "app"
|
|
__version__text__ = "1"
|
|
|
|
sentry_sdk.init("https://3fa5ae886ba1489092ad49a93cb419c1@sentry.kmlabz.com/9")
|
|
|
|
logging.basicConfig(level=logging.INFO)
|
|
LOGGER = logging.getLogger(__name__)
|
|
|
|
if __name__ == "__main__":
|
|
LOGGER.info("Producer started")
|
|
generateduuid = str(uuid)
|
|
LOGGER.debug(f"My uuid is {generateduuid}")
|
|
consumerlocator = ConsumerLocator()
|
|
communicator = Communicator(consumerlocator=consumerlocator,uuid=uuid)
|
|
messagesender = MessageSender(communicator=communicator)
|
|
|
|
while True:
|
|
LOGGER.info("Sending message to consumer")
|
|
messagesender.sendmessage()
|
|
time.sleep(random.random())
|