Finagle, from Twitter

Finagle is a network stack for the JVM that you can use to build asynchronous Remote Procedure Call (RPC) clients and servers in Java, Scala, or any JVM-hosted language. Finagle provides a rich set of protocol-independent tools.

Finagle is written in Scala on top of Netty.

Join in

Join in the conversation and get support. Check out the finaglers Google group.

Fork on GitHub

Download, fork, pull, file issues, and more with the official Finagle repo on Github.

Finagle on GitHub »

Currently v1.9.10

 

Protocols

  • HTTP
  • Streaming HTTP (Comet)
  • Thrift
  • Memcached/Kestrel
  • More to come!

Server Support

  • Backpressure (to defend against abusive clients)
  • Service Registration (e.g., via Zookeeper)
  • Native OpenSSL bindings

Client Support

  • Connection Pooling
  • Load Balancing
  • Failure Detection
  • Failover/Retry
  • Distributed Tracing (a la Dapper)
  • Service Discovery (e.g., via Zookeeper)
  • Rich Statistics
  • Native OpenSSL bindings
  • Sharding

Examples

Check out these basic examples for a quick start using Scala:

  • Echo - A simple echo client and server using a newline-delimited protocol. Illustrates the basics of asynchronous control-flow.
  • Http - An advanced HTTP client and server that illustrates the use of Filters to compositionally organize your code. Filters are used here to isolate authentication and error handling concerns.
  • Memcached Proxy - A simple proxy supporting the Memcached protocol.
  • Stream - An illustration of Channels, the abstraction for Streaming protocols.
  • Spritzer 2 Kestrel - An illustration of Channels, the abstraction for Streaming protocols. Here the Twitter Firehose is "piped" into a Kestrel message queue, illustrating some of the compositionality of Channels.
  • Stress - A high-throughput HTTP client for driving stressful traffic to an HTTP server. Illustrates more advanced asynchronous control-flow.
  • Thrift - A simple client and server for a Thrift protocol.

Build & Test

To build and test the examples:

  1. Install SBT
  2. run sbt update test from the command line

Note: Maven Artifacts are published to the public twitter maven repo at http://maven.twttr.com.

Subprojects

Here is documentation (scaladoc) on selected Finagle subprojects:

For all scaladoc, see API Reference.

Authors

Please see the contributors list