GithubHelp home page GithubHelp logo

edwardt / splitter Goto Github PK

View Code? Open in Web Editor NEW

This project forked from ebowman/splitter

0.0 2.0 0.0 2.38 MB

Request splitting reverse proxy

License: Apache License 2.0

Scala 99.13% Shell 0.15% HTML 0.71%

splitter's Introduction

Splitter

(c) 2011 TomTom International BV

Introduction

Splitter is a transparent reverse proxy which splits incoming HTTP requests into two backend requests, one of which goes to a "reference server", and the other of which goes to a "shadow server". The response from the reference server is sent back as the response to the original request, while the response from the shadow server is discarded. Optionally, the incoming request and both responses may be logged to a MongoDB server.

Splitter is written in Scala, and uses the JBoss Netty library.

Building

Splitter may be built using sbt:

./sbt

> update
> test

Configuration

Configuration is done using a configuration file, similar to those used by the now-defunct "Configgy" library.

port = 8080
reference = "localhost:9090"
shadow = "localhost:9191"

enableShadowing = true

referenceHostname = "reference.test.tomtom.com"
shadowHostname = "shadow.tomtom.com"

# "none" | "mongodb"
capture = "none"

audit {
   level = "info"
   console = true
   truncate = true
   file = "default"
}

pool {
    maxOpenConnections = 70
    maxWaitMs = 5000
    maxIdleConnections = 8
    msBetweenEvictionRuns = 10000
    numTestsPerEvictionRuns = 3
    maxIdleTimeMs = 60000
    connectTimeoutMillis = 30000
    receiveTimeoutMillis = 120000
    keepAlive = true
}

mongo {
    host = "localhost"
    port = 27017
    db = "splitter"
}

Running Splitter

To run splitter within sbt, you can do:

> run [path to config file]

There are 3 runnable apps; sbt will ask you which one you want to run; you should run:

tomtom.splitter.layer7.Proxy

If you have built a self-contained jar (using 'sbt assembly'), you can run it like:

java -jar splitter-assembly-0.14-SNAPSHOT.jar [path to config file]

Future Directions

This tool is still pretty raw, but already useful. It might be nice to support other means besides MongoDB for logging requests.

Also note that it assumes a few ports are free for running the tests; it would be nice to make this configurable or dynamic.

Credits

The idea for this came from https://github.com/neotyk who made an earlier version (but on which this version is only based conceptually).

Thanks to TomTom for letting me release this as ASL.

Enjoy!

Eric Bowman [email protected]

splitter's People

Contributors

ebowman avatar

Watchers

 avatar  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.