Building high-level microservices with nameko
In this section, we'll take a look at nameko, which will help us put together a microservice that communicates using the Advanced Message Queuing Protocol (AMQP), which we can safely think of as a Remote Procedure Call (RPC) protocol, though that's actually only a part of what it does.
Installing nameko
Using HTTP to define the interface for our microservice has the advantages of familiarity and good integration with web technologies, but there's a certain amount of overhead involved in mapping the request and input data onto the functions and parameters that are actually meaningful to us.
We can come up with abstractions that hide that part of the process, of course. That's essentially what the authors of nameko did, although they use AMQP instead of HTTP to transport data and events.
Installing nameko itself is easy. Use pretty much the same pip
command we always use, as shown here:
python3 -m pip install nameko
The output of the preceding command...