I want to send messages in large amount(approx. 500k) at once in rabbitMQ using pika in python. One of the way is to iterate over all the messages and send them sequentially, but that will be slow.
Is there any way to resolve this problem ?
AMQP by default does not provide any batch mechanism, so with pika you can't batch the messages.
btw you can use some tips as:

aggregate the messages client-side, so more messages in one
you can create a compressed message, like a zip/lzo or some lib can compress/uncompress in memory.

Note: if you want to compress the messages, 500k is too high you should split them
Sending messages in batch in rabbitMQ using pika