Making a call to our service

Our microservice is now running! In order to make our own calls, we can launch a Python shell that has Nameko integrated to allow us to call our entrypoints. To access it, open a new terminal window and execute the following:

$ nameko shell 

This should give you access to a Python shell with the ability to make Remote Procedure Calls. Let's try that out:

>>> n.rpc.konnichiwa_service.konnichiwa() 
'Konnichiwa!' 

It worked! We have successfully made a call to our Konnichiwa Service and received some output back. When we executed this code in our Nameko shell, we put a message on the queue, which was then received by our KonnichiwaService. It then spawned a new worker to carry out the work of the konnichiwa RPC.

Get Python Programming Blueprints now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.