Lab 3 - Thrift

Lab tasks

The tasks for today are:

Apache Thrift

Apache Thrift is a cross-platorfm cross-language RPC library.

Example Source

Download the source code. Unzip the code and explore the sources in the Example-XXX directories.

C++

Java

Node

Python

Running the example

C++

  1. Compile the programs
  2. Run the server
  3. Run the client

Setting up Thrift directories

If you have installed thrift manually to your home directory (for example if using lab computers), you might have to set up directory paths, so that the compiler and the linker can find the necessary files.

Java

  1. Compile the client
  2. Run the C++ server
  3. Run the client

Node

  1. Install required packages
  2. Generate code
  3. Run the C++ server
  4. Run the client node .

Python

  1. Generate code
  2. Run the C++ server
  3. Run the client

Lab activity task

With a client in any language, connect to our server at lab.d3s.mff.cuni.cz:5000, and call the method with your own unique string. The server will respond with a text containing an integer key. Send this by e-mail to the lab teacher.

Note: if you do not receive an integer key on the first try, then follow the instructions you received.

Homework task

Running the example

  1. Compile the program
  2. Run the program