л/р 4 Юденичева Дарья

This commit is contained in:
2023-12-20 19:57:51 +03:00
parent 75b9b7df84
commit 9d4e31cae6
26 changed files with 467 additions and 0 deletions

View File

@@ -0,0 +1,19 @@
import pika
import time
import random
collection = ["Application for general business expenses", "The contract is completed", "Enrollment order completed", "Student enrolled"]
connection = pika.BlockingConnection(pika.ConnectionParameters('localhost'))
channel = connection.channel()
channel.exchange_declare(exchange='Agreements', exchange_type='fanout')
while True:
message = f"Message: {random.choice(collection)}"
channel.basic_publish(exchange='Agreements', routing_key='', body=message)
time.sleep(1)
connection.close()