How to import large definition files in RabbitMQ
search cancel

How to import large definition files in RabbitMQ

book

Article ID: 293169

calendar_today

Updated On:

Products

VMware RabbitMQ

Issue/Introduction

Importing large definition files in RabbitMQ can be problematic. You often have to split these files into multiple smaller files in order to import the definitions successfully. This article discusses how to import large JSON definition files in RabbitMQ.This is applicable to both OSS RabbitMQ and VMware RabbitMQ for Tanzu Application Service versions.

Resolution

Client inactivity timeouts for HTTP API endpoints may cause the import to fail.


Some HTTP API endpoints respond quickly, while others may need to return or stream a sizable data set to the client over many thousands of connections. Additionally, some HTTP API endpoints may need to perform an operation that takes an amount of time proportional to the input. In these cases, the amount of time it takes to process the request can exceed certain timeouts in the Web server and the HTTP client.
 

Here is an example of importing a large JSON definitions file “cf-rabbitmq.json", 
 

rabbitmqadmin -P 15672 -u admin -p password --request-timeout 360000 import ~/Downloads/cf-rabbitmq.json
 
  • To track the status of the import process, review the RabbitMQ server logs, as it might take some time.
  • If necessary, increase the timeout value above, for a successful completion of import. For example, if your JSON file contains thousands of Vhosts and/or exchanges, you may need to increase this value.
  • Please note that the exported definitions contain all broker objects, including users. This means that the default-user credentials will be imported from the definitions, and will not be the one which is generated at the creation of the RabbitMQ cluster.


References

Management Command Line Tool
Schema Definition Export and Import
Backup and Restore