Ankit Bansal
Ankit Bansal

Reputation: 2358

Api Gateway for Services

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

Answers (2)

Muatik
Muatik

Reputation: 4171

There are two popular projects could be used in your case:

  1. camel: By defining XML rules, you can create flows between services or even beans. I used Camel for similar tasks.

  2. zuul: This is like a router, you can redirect requests to other services immediately or write some logic to control the flow.

Upvotes: 0

glytching
glytching

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:

  • Both in-process and remote invocations
  • Non functionals such as correlation identifiers, throttlers, delayers etc.

Upvotes: 1

Related Questions