Hey @Tamimi > ,
The message is a json dictionary encoded using ASCII through simple binary encoding.
encoded message bytestring, encoded using ASCII through simple binary encoding
msg = ‘x00Deposit\x00\x00\x00ftx\x00\x00\x00\x00\x00\x00\x00USD\x00obHN&`C@\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x002022-01-06T04:26:06.0491926172157\x00’
converted to bytearray
outbound_msg = bytearray(msg)
when print the message dump directly, i get this error:
‘utf-8’ codec can’t decode byte 0xbf in position 484: invalid start byte
I believe the error comes from when I convert to a bytearray. Can I directly pass in the msg (bytestring) to the publisher?
Instead of bytearray, I used list () to make it > a bytearray:
outbound_msg = list(msg)
Then I used:
message_dump = message.get_payload_as_bytes()
but I cant seem to receive the same bytestring as what was passed in, cause it cant be processed by my decoder.