Reputation: 255
I have two small micro services developed using spring boot. For communication between these two services, I am not using any api gateway or messaging layer.
I am planning to call other service using URL ( http://. I will be using rest template here.
What could be the disadvantages for not using any api gateway here for communication between two services.
Upvotes: 1
Views: 4482
Reputation: 213
API Gateway is not for communicating between services, as mentioned in the previous answer it would be a gate for requests before they access your microsrvices. However, it seems that you would like to have synchronous microservices approach, which has the following drawbacks:
The only benefit I can think of is that your business use-cases will be better controlled and more clear than the reactive event driven ones.
Upvotes: 0
Reputation: 3416
I don't think you wanna use API gateway for communication between your services. API Gateway is used for providing a service where all the external API calls are going through.
If you don't wanna use messaging, they you can go straight with RestTemplate
as you mentioned but keep in mind that if you are referencing the services directly with IP and port, it might be painful to run it in different environments in the future.
I guess you are using the Spring Cloud Netflix stack and if that's the case I'd say go with using Eureka for storing the service metadata and go straight with Feign. It has an integration with Eureka where you can basically resolve logical names into actual IP and port numbers like the following:
http://some-service/endpoint -> http://12.34.56.78:9101/endpoint
In this case you can save time on the long run when you wanna deploy your application into different kind of environments with different network setups and port configurations.
Upvotes: 3