Version 2

    I'm exploring how the Fabric8 Gateway can leverage Overlord APIMan.

     

    At the moment Fabric8 has two gateway implementations:

    - an HTTPGateway for HTTP based traffic:

    - a TCPGateway which uses vert.x as framework. This gateway supports multiple messaging clients with A-MQ using any protocol (OpenWire, STOMP, MQTT, AMQP or WebSockets)

    These gateways can map an incoming request to a service on Fabric8, much a like Apache Proxy does for JBossWeb.

     

    HTTP

    The 'public void handle(final HttpServerRequest request)' method on the HTTPGatewayHandler handles an incoming HTTP request. It is likely the best place to add integration here with APIMan; we'll need to settle on the payload that APIMan requires to do it's thing. Note that since the gateways are high volume the integration should -if at all possible- happen asynchronously. That said, certain use cases may require synchronous APIMan interaction to enable blocking requests, still the gateway itself should probably remain non blocked to handle the next request. Just the proxy request wouldn't get executed until we'd get the green light from APIMan.

     

    TCP

    Messages are decoded using the the A-MQ libraries and it is not yet clear to me where in the code we can insert the APIMan integration in this case as the 'public void handle(final NetSocket socket)' of the TCPGatewayHandler deals with sockets and not with messages.