Open BlackRose01 opened 1 year ago
Apologies for the delay!
As soon as I try to store the information then the Property "disappears" from the message object from the method "__check_userprops" (on_message) and I don't know why.
Sorry - I'm having a little difficulty following this. Is there any chance you could provide a minimal, reproducible, example (your code is close; if you could just tweak it so it runs the same as "Demo Code" that would be great!). The output I get from "Demo Code" is as follows (I'm assuming that this is the correct output that you expect; what's the output from the other code?):
pythondocker-1 | correlation= [UserProperty : [('filename', 'test.txt'), ('count', '1')]]
pythondocker-1 | RECV Topic = test/mqtt
pythondocker-1 | RECV MSG = test message
pythondocker-1 | properties received= [UserProperty : [('filename', 'test.txt'), ('count', '1')]]
pythondocker-1 | user properties received= {'UserProperty': [('filename', 'test.txt'), ('count', '1')]}
Hello,
I wrote a class which should test MQTT Brokers. The method "check_userprops" checks if it is possible to send and receive User Properties. I can see the message incl. the Properties in my MQTT Explorer (MQTTx). So this works but the problem is that I cannot store the received Properties in a variable. As soon as I try to store the information then the Property "disappears" from the message object from the method "__check_userprops" (on_message) and I don't know why. Even when I change the on_message method to a class method it is not possible to store the information. When I switch from a class to a non-class code (Demo Code) then everything works fine.
Do I have a thinking problem in my code or am I understanding something completely wrong?
Thanks in advance!
KR, BlackRose01
Configuration object for My Code
My Code
Demo Code