Giter VIP home page Giter VIP logo

chaos's Introduction

Chaos

A lightweight framework for writing REST services in Scala.

Chaos (Greek χάος, khaos) refers to the formless or void state preceding the creation of the universe or cosmos in the Greek creation myths. Chaos (the framework) precedes creation of a universe of services.

Why yet another framework?

At Mesosphere we're building REST services in Scala, and we wanted a solid foundation. We had experience with Dropwizard and Twitter Commons, which are both great Java frameworks, but are a bit hard to use from Scala. We also experimented with Play!, but it does many things besides REST, which adds unnecessary baggage.

Design Goals

We wanted a framework that

  • is easy to use
  • does one thing really well (REST)
  • feels good in Scala
  • is built on battle-tested and well-supported libraries
  • doesn't try to reinvent the wheel

Building Blocks

There are great JVM libraries for every part of a REST stack. Chaos just glues these together.

Getting Started

Requirements

  • JDK 1.8+
  • SBT 0.13.x+

Example App

There is an example app in [src/main/scala/mesosphere/chaos-examples/] (https://github.com/mesosphere/chaos/blob/master/src/main/scala/mesosphere/chaos-examples/Main.scala). To run the example:

sbt run

Make requests to the example endpoints with HTTPie:

http localhost:8080/persons
http localhost:8080/persons name=Bunny age=42

Built in Endpoints

  • /ping - health check.
  • /metrics - metrics as JSON
  • /logging - configure log levels at runtime

Using Chaos in your Project

Chaos releases are available from Mesosphere's Maven repository.

Maven

To add Chaos to a Maven project, add this to your pom.xml:

<properties>
    <chaos.version>0.5.2</chaos.version>
</properties>

...

<repositories>
    <repository>
        <id>mesosphere-public-repo</id>
        <name>Mesosphere Public Repo</name>
        <url>http://downloads.mesosphere.io/maven</url>
    </repository>
</repositories>

...

<dependencies>
    <dependency>
        <groupId>mesosphere</groupId>
        <artifactId>chaos</artifactId>
        <version>${chaos.version}</version>
    </dependency>
</dependencies>

SBT

To add Chaos to an SBT project, add this to your build.sbt:

resolvers += "Mesosphere Public Repo" at "http://downloads.mesosphere.io/maven"

libraryDependencies ++= Seq(
  "mesosphere" % "chaos" % "0.5.2",
  "com.sun.jersey" % "jersey-bundle" % "1.17.1"
)

Getting Help

If you have questions, please post on the Chaos Users Group email list. The team at Mesosphere is also happy to answer any questions.

Authors

Current Users

  • Marathon, an Apache Mesos framework for long-running services.
  • Chronos, a fault tolerant job scheduler that handles dependencies and ISO8601 based schedules.

chaos's People

Contributors

aquamatthias avatar benmccann avatar connordoyle avatar drexin avatar florianleibert avatar gkleiman avatar guenter avatar johanatan avatar kadwanev avatar kensipe avatar readmecritic avatar ssorallen avatar swartzrock avatar

Watchers

 avatar

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.