Publishing single messages to a RabbitMQ queue can be easily done with the UI, by simply putting the message in the UI and clicking the "Publish Message" button.
How do you publish a batch of messages?
I have a file with messages to be sent to RabbitMQ. Each line has one message.
How can I publish all the messages from the file to my RabbitMQ server?
Is there a way to do it from command line?
Using rabbitmqadmin
while read -r line; do
echo $line | rabbitmqadmin publish exchange=amq.default routing_key=my_queue ;
done < messages
Not specifying the payload parameter to rabbitmqadmin publish
means it reads the payload from stdin.