Just a sample playground project for Apache Thrift integrations.
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.
Common API: /api
- /api/src/main/thrift – contains the API definition (taken from some public Thrift example).
The other projects will use it (both client and server ones) and generate the needed boilerplate code from it.
Uses sbt to build. No manual steps are normally required, the APIs are built automatically using the configured sbt plugin.
- /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).
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