This commit is contained in:
Anna Sentimental 2023-12-16 21:04:41 +04:00
parent 07a0377cbb
commit 6bcfec3c0f
4 changed files with 4 additions and 4 deletions

View File

@ -2,7 +2,7 @@ import pika
import time
import random
collection = ["Application for general business expenses", "The contract is completed", "Enrollment order completed", "Student enrolled"]
collection = ["the employment document", "The document is agreed", "Signatures are provided", "the employee is accepted"]
connection = pika.BlockingConnection(pika.ConnectionParameters('localhost'))
channel = connection.channel()

View File

@ -37,7 +37,7 @@ import pika
import time
import random
collection = ["Application for accommodation in a dormitory", "Rector's order", "Conclusion of an agreement", "Check-into a dormitory"]
collection = ["the employment document", "The document is agreed", "Signatures are provided", "the employee is accepted"]
connection = pika.BlockingConnection(pika.ConnectionParameters('localhost'))
channel = connection.channel()
@ -107,12 +107,12 @@ channel.start_consuming()
Результат отработки Consumer_1:
![](pic/Screenshot_12.jpg)
![](pic/Screenshot_16.jpg)
![](pic/Screenshot_13.jpg)
Результат отработки Consumer_2:
![](pic/Screenshot_14.jpg)
![](pic/Screenshot_17.jpg)
![](pic/Screenshot_15.jpg)
Вывод: Consumer_2 нагружает меньше памяти, чем Consumer_1 и принимает сообщения гораздо быстрее, тем самым не позволяя очереди накапливать огромное количество сообщений.

Binary file not shown.

After

Width:  |  Height:  |  Size: 67 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 73 KiB