I want to send a messge to RabbitMQ in a dictionary format:
import pika
# ....
my_msg = {}
my_msg["a"] = 1
my_msg["a"]["b"] = 2
channel.basic_publish(exchange="", routing_key="some_key", body=my_msg)
And an error I get:
TypeError: unhashable type: 'slice'
Note that I have plenty of my_msg
and each of them has a few keys, so I need somehow to be able to send a list dictionaries to RabbitMQ.
How can I do that? Or are there other options?