GithubHelp home page GithubHelp logo

davidmgross / proteus-httpgateway Goto Github PK

View Code? Open in Web Editor NEW

This project forked from netifi-proteus/proteus-httpgateway

0.0 0.0 0.0 915 KB

Gateway that allows bridging HTTP and Netifi Proteus

Home Page: https://www.netifi.com

License: Apache License 2.0

Shell 3.23% Dockerfile 0.40% Java 96.37%

proteus-httpgateway's Introduction

Netifi Proteus HTTP Gateway

Build Status

An API Gateway that allows bridging HTTP with Netifi Proteus.

How does the Proteus HTTP Gateway work?

The diagram below shows the high-level architecture of how messages are received and routed by the Proteus HTTP Gateway.

diagram

1. Send HTTP Request

Client makes an HTTP POST request to a URL in one of the following format:

If automatic load-balancing across a group of services is desired:

https://{gateway host}/{group}/{service}/{method}

If a specific service instance is desired:

https://{gateway host}/{group}/{destination}/{service}/{method}

The request body must be in JSON format and the field names much match those of the service IDL.

2. Convert HTTP Request to Proteus

The incoming HTTP request is mapped to a Proteus Service IDL based on the URL and request body. The JSON request body fields must match the fields on the IDL exactly.

If no matching IDL can be found an error is returned.

3. Send Request via Proteus Channel

The request is then sent to the Proteus Broker cluster which transparently handles service discovery and load balancing to the backend services.

If a destination was specified in the URL then the request will be sent to that specific instance. If only a group was specified, Proteus will load balance the request to the healthiest, most performant instance, in the group using our Predictive Load Balancing algorithm.

4. Invoke Service Method

The request arrives and invokes the Proteus service method.

5. Send Response via Proteus Proteus Channel

The Proteus service response is sent to the Proteus Broker cluster via the same bidirectional channel used by the request.

6. Send HTTP Response

The Proteus service response is converted into an HTTP response with a JSON message body and sent back to the requesting client to complete the interaction.

Building Proteus HTTP Gateway

You can build Proteus HTTP Gateway as an executable jar using the following command:

$ ./gradlew clean build

Examples

Please see the included demo project for an example on how to configure and use Proteus HTTP Gateway.

Bugs and Feedback

For bugs, questions, and discussions please use the Github Issues.

License

Copyright 2018 Netifi Inc.

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.