Chapter 11. Building clients and servers with C++
This chapter covers
- Configuring Apache Thrift for C++ development
- Building C++ RPC clients and servers with Apache Thrift
- Understanding the features of the Apache Thrift C++ library
- Maximizing Apache Thrift C++ performance
The C++ programming language is one of the core Apache Thrift languages, generally considered the reference implementation for cross-language compatibility testing. Many developers use C++ due to the performance of the executables it produces. Apache Thrift makes it easy to build distributed applications that integrate the performance of C++ services with clients coded in a variety of languages.
In this chapter, we’ll begin our Apache Thrift C++ exploration with a look at the C++ library’s dependencies and build process on several platforms. Next we’ll look at a simple RPC client and server to get familiar with the basics. Then we’ll review the features of the Apache Thrift C++ library and its architecture, and finish up with an advanced non-blocking server example.
Apache Thrift C++ setup is a little more complex than configuration for other languages. We pay this price in trade for the ability to create fast, memory-efficient, native programs.
As a first step in the setup process we need to decide how to use the Apache Thrift C++ library code. We have three options:
- Shared libraries
- Static libraries
- Source