[RabbitMQ] Json Data Send/Receive
Python에서 RabbitMQ 기반으로 JSON 메시지를 송/수신 하는 예제이다. import json channel.basic_publish(exchange='', routing_key='task_queue', body=json.dumps(message), properties=pika.BasicProperties( delivery_mode = 2, # make message persistent )) def callback(ch, method, properties, body): print(" [x] Received %r" % json.loads(body))
2023.06.02