Reputation: 2358
I am developing web services in Java. Now lets say I have 10 services and I want all my services are accessible only via Apigateway.
Now lets say I have an API Call which needs to call 4 services say A, B, C, D in order as First A services needs to be call, then using the o/p B and C can be called in parallel then finally using the o/p of B & C call the Services D.
Then combine the o/p and return the response.
Now this series and parallel combination can be anything. Is there any open source implementation which does this. I mean i provide the scenario and it automatically sends the requests or do I have to develop this gateway?
Upvotes: 1
Views: 635
Reputation: 4171
There are two popular projects could be used in your case:
camel: By defining XML rules, you can create flows between services or even beans. I used Camel for similar tasks.
zuul: This is like a router, you can redirect requests to other services immediately or write some logic to control the flow.
Upvotes: 0
Reputation: 47945
This ...
First A services needs to be call, then using the o/p B and C can be called in parallel then finally using the o/p of B & C call the Services D.
... sounds like an enterprise integration pattern. Both Spring Integration and Camel provide support for composing/orchestrating service calls.
In your example, the calls could be composed into a 'message flow' (defined in XML or in these libraries' internal DSLs) and this message flow could use the libraries' built-in support for routing calls, multi casting calls, aggregating responses etc. Routing A
to B
, C
might use multi casting, using the outputs from B
and C
to invoke D
might use aggregation and routing.
In addition, these libraries support:
Upvotes: 1