You can’t send native Python types as your payload, you have to serialize them first. I recommend using JSON:
import json
channel.basic_publish(exchange="",
routing_key='task_queue',
body=json.dumps(message),
properties=pika.BasicProperties(
delivery_mode = 2, # make message persistent
))
and
def callback(ch, method, properties, body):
print(" [x] Received %r" % json.loads(body))