Hi folks,
I have been working in a project, where we are migrating our monolith/on-premise system to a micro-service architecture.
We've decided some services will be totally redesigned in order to be multitenant and reach a good performance, those we are moving to the cloud, some services are not that critical, those we are just refactoring and keeping them on-premise due to legacy database dependencies.
After all, we are ending with some services on the cloud and some on-premise, and those have to communicate to each other. In order to achieve that, we've created two cluster of rabbitmq (one on the cloud, the other on-premise), and for connect both of them a third RabbitMQ configured as a Shovel (attached figure illustrated the architecture).
We are using a Dynamic Shovel with exchange to exchange connection in order to get the work done. Basically we configure one shovel for each service (IMPORTANT: we release new services every month):
- SERVICE B: FROM uri=amqp//user:password@cloud-ip/ exchange=boundary routing-key=mycompany.service-b TO uri=amqp//user:password@on-premise-ip/ exchange=boundary routing-key=
- SERVICE A: FROM uri=amqp//user:password@on-premise-ip/ exchange=boundary routing-key=mycompany.servoce-a TO uri=amqp//user:password@cloud-ip/ exchange=boundary routing-key=
In such a way, if Service B on-premise send a message to RK=mycompany.service-a, the shovel grabs it and send to the cluster on the cloud
In such a way, if Service A on the cloud send a message to RK=mycompany.service-b the shovel grabs it and send to the cluster on-premise
Everything works pretty well, except when the shovel looses connection, once the Dynamic Shovel bound to a exchange creating a exclusive queue, once I loose the connection the queue is deleted and all messages goes down with them.
The problem is that I cannot loose those messages, once they are business events that shall reach its service destination.
One way to solve that is bind the shovel to queues and not exchange, however it does require to local configure a bind from the exchange for each new service that is added.
If I could keep all shovel configuration on the cloud, that would make the shovel administration much easier.
Do your guys know a good way to solve that? I was thinking about a shovel (dynamic + exchange) that do not create exclusive queue and bind always to the same queue generated name, does such a feature exists?
Thanks and Regards.