Skip to content

amyodov/example-thrift-app

Repository files navigation

Example-Thrift-App


Just a sample playground project for Apache Thrift integrations.

Features

Note: may change in future without any warning (this is a playground!)

  • API defined using Thrift specification; language-specific interfaces are autogenerated.
  • Served by Twitter Finagle embedded RPC server.
    • working in ThriftMux mode;
    • using MethodPerEndpoint Thrift-Finagle integration;
    • using Thrift framed transport (hence non-blocking);
    • using default Binary protocol for serialization.

Components and languages

Common API: /api

The other projects will use it (both client and server ones) and generate the needed boilerplate code from it.

Scala

Uses sbt to build. No manual steps are normally required, the APIs are built automatically using the configured sbt plugin.

Some common API code

  • /api/src/main/scala – some (completely unnecessary for functioning) code to test out the API serialization aspects.

RPC server: /server

Launches the Finagle-ThriftMux server at 127.0.0.1:8000.

Build and run it using:

sbt server/run

(or sbt '~server/run' if you want auto-restarting it if source files are edited).

RPC client: /client

Connects to the Finagle-ThriftMux server at 127.0.0.1:8000 and tries the available operations.

Build and run it using:

sbt client/run

(or sbt '~client/run' if you want auto-restarting it if source files are edited).

Ruby

RPC client: /client-rb

Needs some manual actions (calling the Thrift compiler to build the API into the autogenerated access code) before running. See the /client-rb/README.md file for details.

Then, similarly to the Scala client implementation, connects to the RPC server at 127.0.0.1:8000 and tries the available operations.

After building (see /client-rb/README.md), run it using:

ruby client.rb

Read more

Thrift

Finagle

About

Just a playground of Apache Thrift integration with Scala, Ruby and other languages.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published