Search code examples
rabbitmqmessage-queueamqp

How to import and export messages to queue in RabbitMQ


We are developing a system which uses rabbitMQ for sending and receiving data between its clients and servers. The internet connection may sometimes be lost.

1- Can all the messages in the queue be exported to a file ? And somehow be imported to the client using this file?

2- In a different scenario, a client wants to send some messages to the queue but it has no internet connection! So we want to export all the message from client and make a file and somehow send it to the server (eg. transfer it to another location which has internet), Is this possible to import this file to the queue?


Solution

  • I had the same questions as I wanted to replay messages for testing / load testing purposes.

    I made RabbitDump, a dotnet tool, to do this. It allows you to do all possible transfers from AMQP to and from Zip (bunch of messages). Examples: AMQP => ZIP, AMQP => AMQP, ZIP => AMQP and ZIP => ZIP (because why not ..).

    The tool can be found here. It's installable as a dotnet tool, using dotnet tool install --global MBW.Tools.RabbitDump.