Navigation

Finatra builds on TwitterServer and uses Finagle, therefore it is highly recommended that you familiarize yourself with those frameworks before getting started.

The version of Finatra documented here is version 2.x. Version 2.x is a complete rewrite over v1.x and as such many things are different.

For high-level information about the changes from v1.x see the blog post here.

Finatra at its core is agnostic to the type of service or application being created. It can be used to build anything based on TwitterUtil: c.t.app.App.

For servers, Finatra builds on top of the features of TwitterServer (and Finagle) by allowing you to easily define a Server and controllers (a Service-like abstraction) which define and handle endpoints of the Server. You can also compose Filters either per controller, per route in a controller, or across all controllers.

There is a downside to publishing test-jars in this manner: transitive test-scoped dependencies are not resolved. Maven and sbt only resolve compile-time dependencies transitively, so you will need to specify all other required test-scoped dependencies manually.

For example, the finatra-http test-jar depends on the inject-app test-jar (among others). You will have to manually add a dependency on the inject-app test-jar when using the finatra-http test-jar since the inject-app test-jar will not be resolvedtransitively.

Using the sbt-dependency-graph plugin, you can list the dependencies of the finatra-http test configuration for the packageBin task:

In this case, when executing the packageBin task for finatra-http in the test configuration these dependencies are necessary. Unfortunately, this listing does not explicity state if it’s the compile-time or the test-jar version of the dependency that is necessary. However, it is safe to assume that if you want a dependency on the finatra-http test-jar you will also need to add dependencies on any test-jar from the listed dependencies as well.

Finatra is an open source project that welcomes contributions from the greater community. We’re thankful for the many people who have already contributed and if you’re interested, please read the contributing guidelines.