All Projects → burakkose → Quark

burakkose / Quark

Licence: Apache-2.0 license
Quark is a streaming-first Api Gateway using Akka

Programming Languages

scala
5932 projects

Projects that are alternatives of or similar to Quark

Es Cqrs Shopping Cart
A resilient and scalable shopping cart system designed using Event Sourcing (ES) and Command Query Responsibility Segregation (CQRS)
Stars: ✭ 19 (+46.15%)
Mutual labels:  akka, akka-http, akka-streams
akka-cookbook
提供清晰、实用的Akka应用指导
Stars: ✭ 30 (+130.77%)
Mutual labels:  akka, akka-http, akka-streams
Squbs
Akka Streams & Akka HTTP for Large-Scale Production Deployments
Stars: ✭ 1,365 (+10400%)
Mutual labels:  akka, akka-http, akka-streams
khermes
A distributed fake data generator based in Akka.
Stars: ✭ 94 (+623.08%)
Mutual labels:  akka, akka-http, akka-streams
Otoroshi
Lightweight api management on top of a modern http reverse proxy
Stars: ✭ 177 (+1261.54%)
Mutual labels:  akka, akka-http, akka-streams
akka-http-circe-json-template
Akka HTTP REST API Project Template using Akka HTTP 10.0.4 with Circe 0.7.0 targeting Scala 2.12.x
Stars: ✭ 21 (+61.54%)
Mutual labels:  akka, akka-http, akka-streams
slicebox
Microservice for safe sharing and easy access to medical images
Stars: ✭ 18 (+38.46%)
Mutual labels:  akka, akka-http, akka-streams
typebus
Framework for building distributed microserviceies in scala with akka-streams and kafka
Stars: ✭ 14 (+7.69%)
Mutual labels:  akka, akka-http, akka-streams
Scale
Another example of a REST API with Akka HTTP
Stars: ✭ 23 (+76.92%)
Mutual labels:  akka, akka-http, akka-streams
Scala Ddd Example
🎯 λ Hexagonal Architecture + DDD + CQRS applied in Scala using Akka HTTP
Stars: ✭ 86 (+561.54%)
Mutual labels:  akka, akka-http
Alpakka Kafka
Alpakka Kafka connector - Alpakka is a Reactive Enterprise Integration library for Java and Scala, based on Reactive Streams and Akka.
Stars: ✭ 1,295 (+9861.54%)
Mutual labels:  akka, akka-streams
telepooz
Functional Telegram Bot API wrapper for Scala on top of akka, circe, cats, and shapeless
Stars: ✭ 26 (+100%)
Mutual labels:  akka, akka-streams
Travesty
Diagram- and graph-generating library for Akka Streams
Stars: ✭ 83 (+538.46%)
Mutual labels:  akka, akka-streams
Swagger Akka Http Sample
Sample demonstrating use of swagger-akka-http
Stars: ✭ 79 (+507.69%)
Mutual labels:  akka, akka-http
Akka Http
The Streaming-first HTTP server/module of Akka
Stars: ✭ 1,163 (+8846.15%)
Mutual labels:  akka, akka-http
Kebs
Scala library to eliminate boilerplate
Stars: ✭ 113 (+769.23%)
Mutual labels:  akka, akka-http
Parquet4s
Read and write Parquet in Scala. Use Scala classes as schema. No need to start a cluster.
Stars: ✭ 125 (+861.54%)
Mutual labels:  akka, akka-streams
Spark As Service Using Embedded Server
This application comes as Spark2.1-as-Service-Provider using an embedded, Reactive-Streams-based, fully asynchronous HTTP server
Stars: ✭ 46 (+253.85%)
Mutual labels:  akka, akka-http
Akka Http Quickstart Scala.g8
Stars: ✭ 103 (+692.31%)
Mutual labels:  akka, akka-http
Safe Chat
IRC-style chat demo featuring full-stack F#, Akka.Streams, Akkling, Fable, Elmish, Websockets and .NET Core
Stars: ✭ 157 (+1107.69%)
Mutual labels:  akka, akka-streams

Quark

Quark is a streaming first API Gateway that handles requests and manipulates them to redirect to internal services.

Table of contents

What is an API Gateway?

An API Gateway is used as a single entry point for numerous internal servers that you do not want to expose publicly. Gateway

Why does Quark exist?

Quark is here to provide API Gateway pattern easily in a functional streaming way.

What is not Quark?

Quark is not an API management solutions. API management solutions are a complex solution that provides design, management, ...

Quick Start

Installation

There is no release yet, It is still under development.

Working with Quark

Quark encourages you to write streaming application via Akka Stream in a functional approach. The main idea of Quark is to handle request from outside world. Quark provides a pipeline which is basically a function that we can represent it by HttpRequest -> HttpResponse.

Details

From a global vision, Quark is an edge server that acts as a front door for all requests from clients to internal servers for controlling and protecting private networks.

Proxy

Operations

In Quark, the pipeline manages all request from outside world by three operations.

Incoming Operation

Request

Incoming action is a simple function that takes HttpRequest and return new HttpRequest. In functional defination, it is HttpRequest -> Either[String, HttpRequest]

If you want to reject request, you can use Left("cause") or finishing transforming, Right(httpReqeust). Here is a simple incoming action for logging

incoming{ req =>
    println("There is a new request")
    Right(req)
}

or rejection:

incoming{ req =>
    println("I don't like this reqeust")
    Left("Just reject it")
}

Endpoint Operation

Endpoint

Endpoint action is a place that the gateway calls a remote server. It is basically HttpRequest -> Either[String, HttpResponse]

Outgoing Operation

Outgoing

Outgoing action is for transforming HttpResponse to HttpResponse. It is HttpResponse -> Either[String, HttpResponse]

Service

To create a service defination with actions:

service("service-id"){
    incoming(...) ~ endpoint(...) ~ outgoing(...)
}

Service ID is necessary. Quark tries to match incoming request by service id. Quark has a service resolver for translating the request into a target URL. For instance:

/user-service/users/1 -> service-id: user-service, remote path: /users/1

!!! Not implemented yet.

Here is an example to define multiple services with concatenation.

service("user-service"){
    incoming(...)
} ~ service("payment-service"){
        outgoing(...) ~ endpoint(...)
}

Gateway

Gateway is the structure that wraps services. It is used to define application behavior.

val gate = gateway{
    service(...){
        ...
    } ~ service(...){
        ...
    } ~ service(...){
        ...
    }
}

Starting Http Server

As we mentioned before, Quark is developed top of Akka. For all HTTP components, it uses Akka Http.

val app: GatewayApp = GatewayApp(g)
app.start("localhost", 8080)

This will start a http server at localhost:8080

Simple Example

here is an example

Authors

Burak Kose [email protected]

Contributing

Contributions are very welcome!

If you see an issue that you would like to fix or improve, please submitting a pull request to help out. The repository is also open for new ideas and code reviewing!

License

Quark is Open Source and available under the Apache 2 License.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].