Home

Awesome

Vert.x http-router

Build Status

Performance

Throughput in operations per second

Regex routerVert.x http-router
219136.313864257.727

You can measure it on your own machine by using the BenchmarkRunner. The http-router should be at least 3 times faster than a regex based RouteMatcher.

Details about the comparison can be found here.

Example


    RouteHandler printUser = (req, params) -> req.
            response().end(params.get(":action") + " " + params.get(":user"));

    RouteHandler printPath = (req, params) -> req.
            response().end("filepath " + params.get("*filepath"));

    Router router = router()
            .get("/api/:user/:action", printUser)
            .get("/*filepath", printPath);

    server.requestHandler(router)
            .listen();

Current state

Goals for this router:

Installation

Maven


    <dependency>
        <groupId>com.github.spriet2000</groupId>
        <artifactId>vertx-http-router</artifactId>
        <version>0.0.2-SNAPSHOT</version>
    </dependency>

Without maven

https://oss.sonatype.org/content/repositories/snapshots/com/github/spriet2000

Thanks

Thanks to Tahseen Ur Rehman, Javid Jamae and Dennis Heidsiek for their clear implementation of a radix tree in java which helped me getting started.

And many thanks to Julien Schmidt for his excellent httprouter!