EDIT: sometimes he posts a message, but instead of posting all the messages in the for loop, he posts only once, for the range of number 0, and sometimes number 1.
Look at these images, I run the file 3 times, but I only get two messages.
But when I run the code directly in a Python shell, it looks like everything goes smoothly. Images here.
And i recorded a video running the code in shell python and by executing the file in vscode terminal: https://vimeo.com/412931730
EDIT2: I put some prints, and it seems that the problem is in sending messages, because the entire loop is printed normally, but the amount of messages sent is only one per loop.
☁ python3 consumer.py
Message: bytearray(b'Message Number >> 0 <<')
Message: bytearray(b'Message Number >> 1 <<')
==== consumer.py file!
...and after run the publisher file 6 times:
☁ 2 python3 consumer.py
Message: bytearray(b'Message Number >> 0 <<')
Message: bytearray(b'Message Number >> 1 <<')
Message: bytearray(b'Message Number >> 0 <<')
Message: bytearray(b'Message Number >> 1 <<')
Message: bytearray(b'Message Number >> 0 <<')
Message: bytearray(b'Message Number >> 1 <<')
Message: bytearray(b'Message Number >> 2 <<')
Message: bytearray(b'Message Number >> 0 <<')
Message: bytearray(b'Message Number >> 1 <<')
Message: bytearray(b'Message Number >> 2 <<')
Message: bytearray(b'Message Number >> 3 <<')
Message: bytearray(b'Message Number >> 0 <<')
Message: bytearray(b'Message Number >> 1 <<')
Message: bytearray(b'Message Number >> 2 <<')
Message: bytearray(b'Message Number >> 3 <<')
Message: bytearray(b'Message Number >> 4 <<')
Message: bytearray(b'Message Number >> 5 <<')
Message: bytearray(b'Message Number >> 6 <<')
Message: bytearray(b'Message Number >> 7 <<')
Message: bytearray(b'Message Number >> 8 <<')
==== consumer.py file!
I copied and pasted the two python files, but in my rabbitmq admin panel it doesn't display any messages and says the queue is empty.
Screenshot: https://imgur.com/a/c51wrBx
python version: Python 3.8.2
service status:
~ sudo systemctl status rabbitmq
● rabbitmq.service - RabbitMQ broker
Loaded: loaded (/usr/lib/systemd/system/rabbitmq.service; enabled; vendor preset: disabled)
Active: active (running) since Tue 2020-04-28 17:32:24 -03; 23min ago
Main PID: 40189 (beam.smp)
Status: "Initialized"
Tasks: 235 (lisudo systemctl status rabbitmq
● rabbitmq.servmit: 9446)
Memory: 111.7M
CGroup: /system.slice/rabbitmq.service
├─40189 /usr/lib/erlang/erts-10.6.4/bin/beam.smp -W w -A 192 -MBas ageffcbf -MHas ageffcbf -MBlmbcs >
├─40300 /usr/lib/erlang/erts-10.6.4/bin/epmd -daemon
├─40638 erl_child_setup 1024
├─40685 inet_gethost 4
└─40686 inet_gethost 4
EDIT: sometimes he posts a message, but instead of posting all the messages in the for loop, he posts only once, for the range of number 0, and sometimes number 1.
Look at these images, I run the file 3 times, but I only get two messages.
But when I run the code directly in a Python shell, it looks like everything goes smoothly. Images here.
And i recorded a video running the code in shell python and by executing the file in vscode terminal: https://vimeo.com/412931730
EDIT2: I put some prints, and it seems that the problem is in sending messages, because the entire loop is printed normally, but the amount of messages sent is only one per loop.
Example:
output:
but i get only two messages:
...and after run the publisher file 6 times:
I copied and pasted the two python files, but in my rabbitmq admin panel it doesn't display any messages and says the queue is empty. Screenshot: https://imgur.com/a/c51wrBx
python version:
Python 3.8.2
service status:
pasted codes:
and: