Reputation: 1966
We have a bunch of microservices written in different programming languages by a variety of teams spanning across different companies. All these services communicate with each other over RabbitMQ(AMQP) middleware. There are consumers and publishers in each microservice which listen to incoming messages and publish on a RabbitMQ exchange respectively. The current architecture is shown in the image below
I want to decouple the RabbitMQ specific consumers and publishers from the microservices and implement them in a separate shared library as follows.
This shared library shall implement RabbitMQ exchange bindings. The consumer in this shared library, should listen to any incoming messages and invoke the relevant method in the target language. Same for publishers, the target language should be able to invoke a method in the shared library responsible to publish message on RabbitMQ.
The reason I want to have a shared library is
The problem that I am currently facing is creating language bindings.
If I decide to write the shared library in Java, since most of the message queuing services have good support for Java, how to achieve language bindings?
I am still planning this and haven't started with the implementation. Please provide some suggestions on approaching this problem.
Upvotes: 0
Views: 188
Reputation: 4649
you are not actually decopling them, you are moving the coupling to a lib in a difficult way, not easy to maintain. Try to follow KISS principle
Upvotes: 1