rodrigoserracoelho / capi-gateway

Light API Gateway implemented with Apache Camel
Apache License 2.0
47 stars 18 forks source link

Camel #11

Closed tavoda closed 2 years ago

tavoda commented 2 years ago

Hi, I found your project and it's very interesting for me because it's API GW in Java ;-). I only don't understand what is purpose of Camel in your project. If you will write some 'REST INVOKER' you are done and you don't need Camel. Are you using also some other features of Camel?

rodrigoserracoelho commented 2 years ago

Hello Pavel, thanks for your interest on CAPI. Well, routing traffic is way more complex than just a rest forward, and because of that, Camel plays an important part into many aspects of a call. With Camel you can easily and out of the box:

And still many many more features. There are other 2 versions available: Light version focused on routing only: https://github.com/surisoft-io/capi-lb Light version with Consul integration only: https://github.com/surisoft-io/capi-consul-lb

Thanks. Best regards, Rodrigo

tavoda commented 2 years ago

I understand capabilities of Camel however I don't see, except some traffic management, possibility to tweak it by 'your' definition. How I'm able to add headers for example?

rodrigoserracoelho commented 2 years ago

You mean with CAPI or Camel itself?

tavoda commented 2 years ago

I mean with CAPI. If not possible, what is best way to make it work with CAPI by Java. I know how to do it in pure Camel. I would like to see what are 'declarative' runtime possibilities, what is Java 'hardcoded' and what is way how to make it declarative. Do you have some vision of plugins or tweaking camel flows to avoid performance problems. For example introduce some additional step for invoking specific endpoint.

rodrigoserracoelho commented 2 years ago

Hello, by design CAPI only reads headers related with Authorization or session persistence (sticky sessions). CAPI is also creating and removing headers between routes, but just for internal control. However, asking CAPI to do operations (CRUD) on specific headers would be very easy to implement.

tavoda commented 2 years ago

Thanks for answering my questions. It will be nice if CAPI will implement dynamic 'workflow' creation where you can setup for each endpoint different pipe. For example for external services I would like to have them on my API gateway but it will only forward requests somewhere without creating zipkin, authorization, ... or even touching it (raw forward which is very fast). Somehow integrate routes defined in Camel DSL with your 'specification'.