jflorez29 / hexagon

The atoms of your platform

Home Page:http://hexagonkt.com

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

logo

The atoms of your platform

BuildImg CoverageImg DownloadImg

Hexagon is a microservices framework that doesn't follow the flock. It is written in Kotlin and uses RabbitMQ and MongoDB. It takes care of:

  • HTTP routing and HTML templates.
  • Serialization and storage of domain classes.
  • Asynchronous communication through events.
  • Task scheduling using Cron expressions.

The purpose of the project is to provide a microservices framework with the following priorities (in order):

  1. Simple to use
  2. Easily hackable
  3. Be small

Performance

Performance is not the primary goal, but it is taken seriously. You can check performance numbers in the TechEmpower Web Framework Benchmarks

DISCLAIMER: The project status is beta. Use it at your own risk. This is the coverage grid:

CoverageGrid

Getting Started

For detailed information about how to create a service, please refer to the Service Life Cycle documentation.

You can create a service from a Lazybones template. To do so type: lazybones create hexagon-service service

Or you can write a Gradle project from scratch (Gradle 3 is required):

build.gradle:

plugins {
    id 'org.jetbrains.kotlin.jvm' version '1.1.2-2'
}

apply plugin: "kotlin"
apply plugin: "application"

mainClassName = 'HelloKt'

repositories {
    jcenter ()
}

dependencies {
    compile ("co.there4.hexagon:server_jetty:0.14.0")
}

src/main/kotlin/Hello.kt:

import co.there4.hexagon.server.*
import co.there4.hexagon.server.jetty.*

fun main(vararg args: String) {
    serve(JettyServletEngine()) {
        get("/hello/{name}") { "Hello ${request["name"]}!" }
    }
}

Now you can run the service with gradle run and view the results at: http://localhost:2010/hello/world

Further Resources

  • Service Life Cycle: provide helpers to create, build and package your services.
  • HTTP: Web routing and filters. It is handled like the Sinatra Ruby framework.
  • Serialization: helper methods to serialize/deserialize data classes using different formats.
  • Storage: utilities to persist Kotlin objects into MongoDB collections.
  • Events: support asynchronous communication with events through the RabbitMQ message broker.
  • Configuration: allow the configuration of the engine by using YAML files.
  • Scheduling: supports the execution of tasks periodically using Cron expressions.
  • Templates: allow the service to render results using Pebble or kotlinx.html.
  • Testing: Hexagon adds utilities to ease the testing of its services.

Contribute

Refer to the contributing.md file for detailed information about Hexagon's development.

License

The project is licensed under the MIT License.

About

The atoms of your platform

http://hexagonkt.com

License:MIT License


Languages

Language:Kotlin 94.9%Language:FreeMarker 2.9%Language:Groovy 0.8%Language:JavaScript 0.6%Language:CSS 0.4%Language:HTML 0.4%