Is there a way to do "migration" in RabbitMQ?

2

Hello

I would like to know if there is any alternative to create / change / remove exchanges, queues and bindings without depending on the framework (in my case, Spring) for this.

We often need to change the name of a Routing Key, Queue, or Exchange, and these frameworks do not allow this kind of more refined change. As a consequence, the tendency is for the original names to remain. In the future, this ends up confusing the organization of the queues because you can not easily maintain their name and eventually reorganize them.

The ideal for me would be a tool that controls this, as with migration tools such as Liquibase, Flyway, etc.

Parallel to the database, currently letting Spring create everything in RabbitMQ seems analogous to letting the hbm2ddl switch on the "update" option in Hibernate.

I know that questions about tools are not appropriate in the OS, but since I did not find any alternatives to this problem then I thought the question was valid.

    
asked by anonymous 07.05.2018 / 15:02

1 answer

1

After search on the subject, I believe that I can not implement a migration for the RabbitMQ queues just like I do for a database.

The possibility of changing them exists, but not in a declarative way. It needs to be done by programming the change.

With Spring, I can use RabbitAdmin.declareBinding() to bind to a different (and / or exchange ) route key. I can use RabbitAdmin.removeBinding() to remove the old one.

You can not change the arguments of a created queue, such as its DLQ ( Dead Letter Queue) or durability

variables.

To move messages from an old queue to a new queue, I can program to do this or use the shovel plugin installed in RabbitMQ itself.

    
05.12.2018 / 21:19