Skip to content
A Thrift parser/generator
Scala Java HTML Thrift Objective-C Shell Other
Latest commit e4649d1 @kevinoliver kevinoliver committed with jenkins scrooge-generator: Handle exceptions thrown in decodeResponse
Motivation

When an exception is thrown in
`ServiceName$FinagleClient.decodeResponse` it is not seen by the
`ResponseClassifier`.

Solution

Wrap the `decodeResponse` call in `Try.apply` and adjust the logic to
handle that.

Result

Clients can now properly classify these exceptions.

RB_ID=796974
Failed to load latest commit information.
bin Default travisci to 2.11.7 similar to finagle/bin/travisci
demos/scrooge-maven-demo release: Prepare libraries for OSS release
doc/src/sphinx release: Prepare libraries for OSS release
project release: Prepare libraries for OSS release
scrooge-benchmark scrooge: cleanup various build warnings
scrooge-core scrooge: cleanup various build warnings
scrooge-generator scrooge-generator: Handle exceptions thrown in decodeResponse
scrooge-linter scrooge: cleanup various build warnings
scrooge-maven-plugin release: Prepare libraries for OSS release
scrooge-ostrich scrooge: cleanup various build warnings
scrooge-runtime csl: disable fatal warnings in java targets
scrooge-sbt-plugin scrooge: Fix name conflict in ScroogeSBT*
scrooge-serializer scrooge: cleanup various build warnings
.gitignore [split] scrooge: Cache mustache resources to improve generation perfo…
.travis.yml Disable openjdk7 in Travis CI builds
CHANGES release: Prepare libraries for OSS release
CONFIG.ini [split] improve SocialGraphUtil exception logging
CONTRIBUTING.md Default travisci to 2.11.7 similar to finagle/bin/travisci
GROUPS [split] improve SocialGraphUtil exception logging
LICENSE [split] improve SocialGraphUtil exception logging
OWNERS util, finagle, scrooge: Add ryano to More Owners Files
README.md scrooge-generator: Fix ServiceGeneratorSpec
pushsite.bash [split] improve SocialGraphUtil exception logging
sbt scrooge: Switch to typesafe repo for sbt-launcher download

README.md

Scrooge

Build status Coverage status Project status Gitter Maven Central

Scrooge is a thrift code generator written in Scala, which currently generates code for Scala and Java.

It's meant to be a replacement for the apache thrift code generator, and generates conforming, compatible binary codecs by building on top of libthrift.

Since Scala is API-compatible with Java, you can use the apache thrift code generator to generate Java files and use them from within Scala, but the generated code uses Java collections and mutable "bean" classes, causing some annoying boilerplate conversions to be hand-written. This is an attempt to bypass the problem by generating Scala code directly. It also uses Scala syntax so the generated code is much more compact.

There is a fairly comprehensive set of unit tests, which actually generate code, compile it, and execute it to verify expectations.

Status

This project is used in production at Twitter (and many other organizations), and is being actively developed and maintained.

Quick-start

There are a couple of classes needed by the generated code. These have been moved out of scrooge into a separate jar to keep dependencies small. Maven users need to add the following to the pom.xml file:

<dependency>
  <groupId>com.twitter</groupId>
  <artifactId>scrooge-core_2.9.2</artifactId>
  <version>3.3.2</version>
</dependency>

SBT users need this:

val scroogeCore = "com.twitter" %% "scrooge-core" % "3.3.2"

Building the develop branch locally

You will need the develop branches of util, ostrich, and finagle. Finagle depends on scrooge-core, so the order in which you build dependencies should be:

  • in util: ./sbt publish-local
  • in ostrich: ./sbt publish-local
  • in scrooge: ./sbt 'project scrooge-core' publish-local
  • in finagle: ./sbt publish-local

Then you can build the entire scrooge package.

Full Documentation

https://twitter.github.io/scrooge/

Something went wrong with that request. Please try again.